(function(g){var window=this;'use strict';var Uz_=function(z){if(z instanceof g.nj)return z;if(typeof z.Yq=="function")return z.Yq(!1);if(g.K1(z)){var K=0,f=new g.nj;f.next=function(){for(;;){if(K>=z.length)return g.vQ;if(K in z)return g.W2(z[K++]);K++}}; return f}throw Error("Not implemented");},z8f=function(z,K,f){if(g.K1(z))g.co(z,K,f); else for(z=Uz_(z);;){var M=z.next();if(M.done)break;K.call(f,M.value,void 0,z)}},Kw9=function(z){this.Yi=g.hG(z)},K$=function(z){g.kn(z,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.N5()).toString(36)); return z},$s=function(z,K,f){Array.isArray(f)||(f=[String(f)]); g.sE5(z.J,K,f)},$uT=function(z,K){var f=[]; z8f(K,function(M){try{var p=g.dy.prototype.Y.call(this,M,!0)}catch(t){if(t=="Storage: Invalid value was encountered")return;throw t;}p===void 0?f.push(M):g.ZrS(p)&&f.push(M)},z); return f},fQT=function(z,K){$uT(z,K).forEach(function(f){g.dy.prototype.remove.call(this,f)},z)},Mg7=function(z){if(z.ES){if(z.ES.locationOverrideToken)return{locationOverrideToken:z.ES.locationOverrideToken}; if(z.ES.latitudeE7!=null&&z.ES.longitudeE7!=null)return{latitudeE7:z.ES.latitudeE7,longitudeE7:z.ES.longitudeE7}}return null},pg8=function(z,K){g.h2(z,K)||z.push(K)},tgT=function(z){var K=0,f; for(f in z)K++;return K},BVS=function(z,K){return g.C1(z,K)},NV4=function(z){try{return g.ZT.JSON.parse(z)}catch(K){}z=String(z); if(/^\s*$/.test(z)?0:/^[\],:{}\s\u2028\u2029]*$/.test(z.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+z+")")}catch(K){}throw Error("Invalid JSON string: "+z);},f$=function(z){if(g.ZT.JSON)try{return g.ZT.JSON.parse(z)}catch(K){}return NV4(z)},vBf=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/channel/opened",g.Dq("channel_type"))},IQ4=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/channel/closed",g.Dq("channel_type"))},GM1=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Dq("channel_type"))},bJQ=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/channel/success")},e89=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/channel/error",g.Dq("channel_type"),g.Dq("error_type"))},wg7=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},DuT=function(){var z=MK(); this.S=z;z.T7("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},yaQ=function(z){if(z.xq&&typeof z.xq=="function")return z.xq(); if(typeof Map!=="undefined"&&z instanceof Map||typeof Set!=="undefined"&&z instanceof Set)return Array.from(z.values());if(typeof z==="string")return z.split("");if(g.K1(z)){for(var K=[],f=z.length,M=0;M1){if(f%2)throw Error("Uneven number of arguments");for(var M=0;M5&&(z=z.slice(z.length-5)); var K=g.UZ(pKZ(),function(M){return M.loungeToken}),f=g.UZ(z,function(M){return M.loungeToken}); g.zd(f,function(M){return!g.h2(K,M)})&&tpH(); g.sT("yt-remote-local-screens",z,31536E3)},Du=function(z){z||(g.jp("yt-remote-session-screen-id"),g.jp("yt-remote-session-video-id")); fF5();z=eC();g.R8(z,wm());K6T(z)},N0p=function(){if(!ys){var z=g.Xi(); z&&(ys=new g.JU(z))}},vaf=function(){N0p(); return ys?!!ys.get("yt-remote-use-staging-server"):!1},ks=function(z,K){g.N1[z]=!0; var f=g.tY();f&&f.publish.apply(f,arguments);g.N1[z]=!1},IF9=function(){},GCf=function(){},MK=function(){if(!h_){h_=new g.Fu(new GCf); var z=g.Q4("client_streamz_web_flush_count",-1);z!==-1&&(h_.T=z)}return h_},b37=function(){var z=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return z?parseInt(z[1],10):0},ez9=function(z){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+z)!=-1||document.currentScript.src.indexOf("&"+z)!=-1)},wKQ=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},aq=function(z){z.length?Dm8(z.shift(),function(){aq(z)}):yV1()},kC_=function(z){return"chrome-extension://"+z+"/cast_sender.js"},Dm8=function(z,K,f){var M=document.createElement("script"); M.onerror=K;f&&(M.onload=f);g.v9(M,g.VY(z));(document.head||document.documentElement).appendChild(M)},hzQ=function(){var z=b37(),K=[]; if(z>1){var f=z-1;K.push("//www.gstatic.com/eureka/clank/"+z+"/cast_sender.js");K.push("//www.gstatic.com/eureka/clank/"+f+"/cast_sender.js")}return K},yV1=function(){var z=wKQ(); z&&z(!1,"No cast extension found")},Rz9=function(){if(aFH){var z=2,K=wKQ(),f=function(){z--; z==0&&K&&K(!0)}; window.__onGCastApiAvailable=f;Dm8("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",yV1,f)}},STZ=function(){Rz9(); var z=hzQ();z.push("//www.gstatic.com/eureka/clank/cast_sender.js");aq(z)},L67=function(){Rz9(); var z=hzQ();z.push.apply(z,g.P(uH7.map(kC_)));z.push("//www.gstatic.com/eureka/clank/cast_sender.js");aq(z)},Rq=function(z,K,f){g.J.call(this); this.W=f!=null?(0,g.p1)(z,f):z;this.MM=K;this.C=(0,g.p1)(this.ZP,this);this.S=!1;this.Y=0;this.T=this.gO=null;this.J=[]},SC=function(){},Ea1=function(){g.$Z.call(this,"p")},Pu8=function(){g.$Z.call(this,"o")},QZT=function(){return H38=H38||new g.kZ},qTp=function(z){g.$Z.call(this,"serverreachability",z)},uO=function(z){var K=QZT(); K.dispatchEvent(new qTp(K,z))},mmS=function(z){g.$Z.call(this,"statevent",z)},L$=function(z){var K=QZT(); K.dispatchEvent(new mmS(K,z))},lFQ=function(z,K,f,M){g.$Z.call(this,"timingevent",z); this.size=K;this.rtt=f;this.retries=M},EV=function(z,K){if(typeof z!=="function")throw Error("Fn must not be null and must be a function"); return g.ZT.setTimeout(function(){z()},K)},PU=function(){},HU=function(z,K,f,M){this.T=z; this.J=K;this.Ft=f;this.LI=M||1;this.SE=new g.u2(this);this.rE=45E3;this.vx=null;this.W=!1;this.N=this.b_=this.D=this.Px=this.nH=this.oa=this.Y1=null;this.l_=[];this.S=null;this.G=0;this.C=this.Hx=null;this.TP=-1;this.Bx=!1;this.VE=0;this.QE=null;this.W1=this.Xc=this.nI=this.eV=!1;this.Y=new Vp8},Vp8=function(){this.T=null; this.S="";this.Y=!1},W61=function(z,K,f){z.Px=1; z.D=K$(K.clone());z.N=f;z.eV=!0;naQ(z,null)},naQ=function(z,K){z.nH=Date.now(); Qs(z);z.b_=z.D.clone();$s(z.b_,"t",z.LI);z.G=0;var f=z.T.Px;z.Y=new Vp8;z.S=JV9(z.T,f?K:null,!z.N);z.VE>0&&(z.QE=new g.Bs((0,g.p1)(z.KA,z,z.S),z.VE));z.SE.listen(z.S,"readystatechange",z.Q3);K=z.vx?g.$o(z.vx):{};z.N?(z.Hx||(z.Hx="POST"),K["Content-Type"]="application/x-www-form-urlencoded",z.S.send(z.b_,z.Hx,z.N,K)):(z.Hx="GET",z.S.send(z.b_,z.Hx,null,K));uO(1)},i3o=function(z){if(!gaf(z))return g.$V(z.S); var K=g.fV(z.S);if(K==="")return"";var f="",M=K.length,p=g.zh(z.S)==4;if(!z.Y.T){if(typeof TextDecoder==="undefined")return qK(z),mX(z),"";z.Y.T=new g.ZT.TextDecoder}for(var t=0;tK.length)return dmT;K=K.slice(M,M+f);z.G=M+f;return K},Qs=function(z){z.oa=Date.now()+z.rE; AVH(z,z.rE)},AVH=function(z,K){if(z.Y1!=null)throw Error("WatchDog timer not null"); z.Y1=EV((0,g.p1)(z.OY,z),K)},jZQ=function(z){z.Y1&&(g.ZT.clearTimeout(z.Y1),z.Y1=null)},mX=function(z){z.T.rI()||z.Bx||YTS(z.T,z)},qK=function(z){jZQ(z); g.DO(z.QE);z.QE=null;z.SE.removeAll();if(z.S){var K=z.S;z.S=null;K.abort();K.dispose()}},Cu9=function(z,K){try{var f=z.T; if(f.Qc!=0&&(f.S==z||XKf(f.Y,z)))if(!z.Xc&&XKf(f.Y,z)&&f.Qc==3){try{var M=f.ES.S.parse(K)}catch(R){M=null}if(Array.isArray(M)&&M.length==3){var p=M;if(p[0]==0)a:{if(!f.D){if(f.S)if(f.S.nH+3E30&&(f.VE=1.5*v);M=f;var I=z.eJ();if(I){var G=g.MY(I,"X-Client-Wire-Protocol");if(G){var b=M.Y;!b.S&&(g.a9(G,"spdy")||g.a9(G,"quic")||g.a9(G,"h2"))&&(b.J=b.C,b.S=new Set,b.Y&&(O37(b,b.Y),b.Y=null))}if(M.eV){var e=g.MY(I,"X-HTTP-Session-Id");e&&(M.b3=e,g.kn(M.vx,M.eV,e))}}f.Qc=3;f.C&&f.C.Zd();f.O3&&(f.E0=Date.now()-z.nH);M=f;var w=z;M.D3=rV9(M,M.Px?M.LI:null,M.Ft);if(w.Xc){Z32(M.Y, w);var D=w,y=M.VE;y&&D.setTimeout(y);D.Y1&&(jZQ(D),Qs(D));M.S=w}else oa1(M);f.T.length>0&&WU(f)}else t[0]!="stop"&&t[0]!="close"||n$(f,7);else f.Qc==3&&(t[0]=="stop"||t[0]=="close"?t[0]=="stop"?n$(f,7):f.disconnect():t[0]!="noop"&&f.C&&f.C.fA(t),f.l_=0)}uO(4)}catch(R){}},T0S=function(z,K){this.S=z; this.map=K;this.context=null},Um_=function(z){this.C=z||10; g.ZT.PerformanceNavigationTiming?(z=g.ZT.performance.getEntriesByType("navigation"),z=z.length>0&&(z[0].nextHopProtocol=="hq"||z[0].nextHopProtocol=="h2")):z=!!(g.ZT.chrome&&g.ZT.chrome.loadTimes&&g.ZT.chrome.loadTimes()&&g.ZT.chrome.loadTimes().wasFetchedViaSpdy);this.J=z?this.C:1;this.S=null;this.J>1&&(this.S=new Set);this.Y=null;this.T=[]},zW4=function(z){return z.Y?!0:z.S?z.S.size>=z.J:!1},F6T=function(z){return z.Y?1:z.S?z.S.size:0},XKf=function(z,K){return z.Y?z.Y==K:z.S?z.S.has(K):!1},O37= function(z,K){z.S?z.S.add(K):z.Y=K},Z32=function(z,K){z.Y&&z.Y==K?z.Y=null:z.S&&z.S.has(K)&&z.S.delete(K)},Kaf=function(z){if(z.Y!=null)return z.T.concat(z.Y.l_); if(z.S!=null&&z.S.size!==0){var K=z.T;z=g.a(z.S.values());for(var f=z.next();!f.done;f=z.next())K=K.concat(f.value.l_);return K}return g.L1(z.T)},$g8=function(z,K){var f=new PU; if(g.ZT.Image){var M=new Image;M.onload=g.Bo(J_,f,"TestLoadImage: loaded",!0,K,M);M.onerror=g.Bo(J_,f,"TestLoadImage: error",!1,K,M);M.onabort=g.Bo(J_,f,"TestLoadImage: abort",!1,K,M);M.ontimeout=g.Bo(J_,f,"TestLoadImage: timeout",!1,K,M);g.ZT.setTimeout(function(){if(M.ontimeout)M.ontimeout()},1E4); M.src=z}else K(!1)},fs9=function(z,K){var f=new PU,M=new AbortController,p=setTimeout(function(){M.abort(); J_(f,"TestPingServer: timeout",!1,K)},1E4); fetch(z,{signal:M.signal}).then(function(t){clearTimeout(p);t.ok?J_(f,"TestPingServer: ok",!0,K):J_(f,"TestPingServer: server error",!1,K)}).catch(function(){clearTimeout(p); J_(f,"TestPingServer: error",!1,K)})},J_=function(z,K,f,M,p){try{p&&(p.onload=null,p.onerror=null,p.onabort=null,p.ontimeout=null),M(f)}catch(t){}},MO5=function(){this.S=new SC},pJH=function(z,K,f){var M=f||""; try{h87(z,function(p,t){var B=p;g.$f(p)&&(B=g.rB(p));K.push(M+t+"="+encodeURIComponent(B))})}catch(p){throw K.push(M+"type="+encodeURIComponent("_badmap")),p; }},gm=function(z,K,f){return f&&f.CP?f.CP[z]||K:K},tOo=function(z){this.T=[]; this.LI=this.D3=this.vx=this.Ft=this.S=this.b3=this.eV=this.Bx=this.G=this.TP=this.N=null;this.PA=this.b_=0;this.BA=gm("failFast",!1,z);this.Xc=this.Y1=this.D=this.W=this.C=null;this.Z2=!0;this.SU=this.QE=-1;this.W1=this.l_=this.nH=0;this.C3=gm("baseRetryDelayMs",5E3,z);this.K3=gm("retryDelaySeedMs",1E4,z);this.Gw=gm("forwardChannelMaxRetries",2,z);this.QW=gm("forwardChannelRequestTimeoutMs",2E4,z);this.Ph=z&&z.P0H||void 0;this.XK=z&&z.HEE||void 0;this.t9=z&&z.maV||!1;this.VE=void 0;this.Px=z&&z.IXq|| !1;this.J="";this.Y=new Um_(z&&z.Msa);this.ES=new MO5;this.SE=z&&z.xP1||!1;this.oa=z&&z.l7E||!1;this.SE&&this.oa&&(this.oa=!1);this.FK=z&&z.Xgc||!1;z&&z.UPx&&(this.Z2=!1);this.O3=!this.SE&&this.Z2&&z&&z.tsd||!1;this.RF=void 0;z&&z.eW&&z.eW>0&&(this.RF=z.eW);this.ra=void 0;this.E0=0;this.rE=!1;this.nI=this.Hx=null},Vs=function(z){z.S&&(BgZ(z),z.S.cancel(),z.S=null)},Ng9=function(z){Vs(z); z.D&&(g.ZT.clearTimeout(z.D),z.D=null);lO(z);z.Y.cancel();z.W&&(typeof z.W==="number"&&g.ZT.clearTimeout(z.W),z.W=null)},WU=function(z){zW4(z.Y)||z.W||(z.W=!0,g.mZ(z.XU,z),z.nH=0)},IsZ=function(z,K){if(F6T(z.Y)>=z.Y.J-(z.W?1:0))return!1; if(z.W)return z.T=K.l_.concat(z.T),!0;if(z.Qc==1||z.Qc==2||z.nH>=(z.BA?0:z.Gw))return!1;z.W=EV((0,g.p1)(z.XU,z,K),viZ(z,z.nH));z.nH++;return!0},b8H=function(z,K){var f; K?f=K.Ft:f=z.b_++;var M=z.vx.clone();g.kn(M,"SID",z.J);g.kn(M,"RID",f);g.kn(M,"AID",z.QE);iO(z,M);z.G&&z.N&&g.SP(M,z.G,z.N);f=new HU(z,z.J,f,z.nH+1);z.G===null&&(f.vx=z.N);K&&(z.T=K.l_.concat(z.T));K=GNT(z,f,1E3);f.setTimeout(Math.round(z.QW*.5)+Math.round(z.QW*.5*Math.random()));O37(z.Y,f);W61(f,M,K)},iO=function(z,K){z.Bx&&g.jS(z.Bx,function(f,M){g.kn(K,M,f)}); z.C&&h87({},function(f,M){g.kn(K,M,f)})},GNT=function(z,K,f){f=Math.min(z.T.length,f); var M=z.C?(0,g.p1)(z.C.MY,z.C,z):null;a:{for(var p=z.T,t=-1;;){var B=["count="+f];t==-1?f>0?(t=p[0].S,B.push("ofs="+t)):t=0:B.push("ofs="+t);for(var v=!0,I=0;I=3)return!1; z.W1++;z.D=EV((0,g.p1)(z.FU,z),viZ(z,z.l_));z.l_++;return!0},BgZ=function(z){z.Hx!=null&&(g.ZT.clearTimeout(z.Hx),z.Hx=null)},eW9=function(z){z.S=new HU(z,z.J,"rpc",z.W1); z.G===null&&(z.S.vx=z.N);z.S.VE=0;var K=z.D3.clone();g.kn(K,"RID","rpc");g.kn(K,"SID",z.J);g.kn(K,"AID",z.QE);g.kn(K,"CI",z.Xc?"0":"1");!z.Xc&&z.RF&&g.kn(K,"TO",z.RF);g.kn(K,"TYPE","xmlhttp");iO(z,K);z.G&&z.N&&g.SP(K,z.G,z.N);z.VE&&z.S.setTimeout(z.VE);var f=z.S;z=z.LI;f.Px=1;f.D=K$(K.clone());f.N=null;f.eV=!0;naQ(f,z)},lO=function(z){z.Y1!=null&&(g.ZT.clearTimeout(z.Y1),z.Y1=null)},YTS=function(z,K){var f=null; if(z.S==K){lO(z);BgZ(z);z.S=null;var M=2}else if(XKf(z.Y,K))f=K.l_,Z32(z.Y,K),M=1;else return;if(z.Qc!=0)if(K.W)if(M==1){f=K.N?K.N.length:0;K=Date.now()-K.nH;var p=z.nH;M=QZT();M.dispatchEvent(new lFQ(M,f,K,p));WU(z)}else oa1(z);else{var t=K.TP;p=K.getLastError();if(p==3||p==0&&t>0||!(M==1&&IsZ(z,K)||M==2&&xmf(z)))switch(f&&f.length>0&&(K=z.Y,K.T=K.T.concat(f)),p){case 1:n$(z,5);break;case 4:n$(z,10);break;case 3:n$(z,6);break;default:n$(z,2)}}},viZ=function(z,K){var f=z.C3+Math.floor(Math.random()* z.K3); z.isActive()||(f*=2);return f*K},n$=function(z,K){if(K==2){var f=(0,g.p1)(z.Fad,z),M=z.XK,p=!M; M=new g.vx(M||"//www.google.com/images/cleardot.gif");g.ZT.location&&g.ZT.location.protocol=="http"||g.Il(M,"https");K$(M);p?$g8(M.toString(),f):fs9(M.toString(),f)}else L$(2);z.Qc=0;z.C&&z.C.gP(K);wJ_(z);Ng9(z)},wJ_=function(z){z.Qc=0; z.nI=[];if(z.C){var K=Kaf(z.Y);if(K.length!=0||z.T.length!=0)g.Po(z.nI,K),g.Po(z.nI,z.T),z.Y.T.length=0,g.L1(z.T),z.T.length=0;z.C.Dd()}},Dg8=function(z){if(z.Qc==0)return z.nI; var K=[];g.Po(K,Kaf(z.Y));g.Po(K,z.T);return K},rV9=function(z,K,f){var M=g.hy(f); M.S!=""?(K&&g.G$(M,K+"."+M.S),g.b2(M,M.T)):(M=g.ZT.location,M=aQp(M.protocol,K?K+"."+M.hostname:M.hostname,+M.port,f));K=z.eV;f=z.b3;K&&f&&g.kn(M,K,f);g.kn(M,"VER",z.ir);iO(z,M);return M},JV9=function(z,K,f){if(K&&!z.Px)throw Error("Can't create secondary domain capable XhrIo object."); K=z.t9&&!z.Ph?new g.Cr(new g.pG({nM:f})):new g.Cr(z.Ph);K.G=z.Px;return K},yOo=function(){},kNQ=function(){},cU=function(z,K){g.kZ.call(this); this.S=new tOo(K);this.C=z;this.Y=K&&K.hdq||null;z=K&&K.xch||null;K&&K.Q3q&&(z?z["X-Client-Protocol"]="webchannel":z={"X-Client-Protocol":"webchannel"});this.S.N=z;z=K&&K.OD_||null;K&&K.Gt&&(z?z["X-WebChannel-Content-Type"]=K.Gt:z={"X-WebChannel-Content-Type":K.Gt});K&&K.pS&&(z?z["X-WebChannel-Client-Profile"]=K.pS:z={"X-WebChannel-Client-Profile":K.pS});this.S.TP=z;(z=K&&K.ZDd)&&!g.h6(z)&&(this.S.G=z);this.W=K&&K.IXq||!1;this.J=K&&K.bEq||!1;(K=K&&K.j6)&&!g.h6(K)&&(this.S.eV=K,g.o8(this.Y,K)&&(z= this.Y,K in z&&delete z[K]));this.T=new dm(this)},hWH=function(z){Ea1.call(this); z.__headers__&&(this.headers=z.__headers__,this.statusCode=z.__status__,delete z.__headers__,delete z.__status__);var K=z.__sm__;K?this.data=(this.S=g.FT(K))?g.zl(K,this.S):K:this.data=z},aso=function(z){Pu8.call(this); this.status=1;this.errorCode=z},dm=function(z){this.S=z},RWZ=function(z,K){this.Y=z; this.S=K},Sx5=function(z){return Dg8(z.S).map(function(K){var f=z.Y; K=K.map;"__data__"in K?(K=K.__data__,f=f.J?NV4(K):K):f=K;return f})},sV=function(z,K){if(typeof z!=="function")throw Error("Fn must not be null and must be a function"); return g.ZT.setTimeout(function(){z()},K)},jC=function(z){A_.dispatchEvent(new uQT(A_,z))},uQT=function(z){g.$Z.call(this,"statevent",z)},Ys=function(z,K,f,M){this.S=z; this.J=K;this.G=f;this.W=M||1;this.Y=45E3;this.T=new g.u2(this);this.C=new g.YZ;this.C.setInterval(250)},Eio=function(z,K,f){z.AS=1; z.gG=K$(K.clone());z.Sl=f;z.eV=!0;La_(z,null)},PNS=function(z,K,f,M,p){z.AS=1; z.gG=K$(K.clone());z.Sl=null;z.eV=f;p&&(z.iF=!1);La_(z,M)},La_=function(z,K){z.OZ=Date.now(); H8Z(z);z.Sc=z.gG.clone();$s(z.Sc,"t",z.W);z.lk=0;z.qr=z.S.mK(z.S.Qu()?K:null);z.Un>0&&(z.oC=new g.Bs((0,g.p1)(z.Oa,z,z.qr),z.Un));z.T.listen(z.qr,"readystatechange",z.bf);K=z.aV?g.$o(z.aV):{};z.Sl?(z.YB="POST",K["Content-Type"]="application/x-www-form-urlencoded",z.qr.send(z.Sc,z.YB,z.Sl,K)):(z.YB="GET",z.iF&&!g.oz&&(K.Connection="close"),z.qr.send(z.Sc,z.YB,null,K));z.S.Rb(1)},mgT=function(z,K){var f=z.lk,M=K.indexOf("\n",f); if(M==-1)return QY7;f=Number(K.substring(f,M));if(isNaN(f))return qxT;M+=1;if(M+f>K.length)return QY7;K=K.slice(M,M+f);z.lk=M+f;return K},H8Z=function(z){z.We=Date.now()+z.Y; ls1(z,z.Y)},ls1=function(z,K){if(z.CR!=null)throw Error("WatchDog timer not null"); z.CR=sV((0,g.p1)(z.kE,z),K)},VOZ=function(z){z.CR&&(g.ZT.clearTimeout(z.CR),z.CR=null)},ni1=function(z){z.S.rI()||z.fl||z.S.Cw(z)},Xn=function(z){VOZ(z); g.DO(z.oC);z.oC=null;z.C.stop();z.T.removeAll();if(z.qr){var K=z.qr;z.qr=null;K.abort();K.dispose()}z.fM&&(z.fM=null)},Wa9=function(z,K){try{z.S.QG(z,K),z.S.Rb(4)}catch(f){}},gi1=function(z,K,f,M,p){if(M==0)f(!1); else{var t=p||0;M--;JO9(z,K,function(B){B?f(!0):g.ZT.setTimeout(function(){gi1(z,K,f,M,t)},t)})}},JO9=function(z,K,f){var M=new Image; M.onload=function(){try{xs(M),f(!0)}catch(p){}}; M.onerror=function(){try{xs(M),f(!1)}catch(p){}}; M.onabort=function(){try{xs(M),f(!1)}catch(p){}}; M.ontimeout=function(){try{xs(M),f(!1)}catch(p){}}; g.ZT.setTimeout(function(){if(M.ontimeout)M.ontimeout()},K); M.src=z},xs=function(z){z.onload=null; z.onerror=null;z.onabort=null;z.ontimeout=null},i8S=function(z){this.S=z; this.Y=new SC},dg9=function(z){var K=Fn(z.S,z.FE,"/mail/images/cleardot.gif"); K$(K);gi1(K.toString(),5E3,(0,g.p1)(z.Ih,z),3,2E3);z.Rb(1)},cO9=function(z){var K=z.S.W; K!=null?(jC(5),K?(jC(11),OV(z.S,z,!1)):(jC(12),OV(z.S,z,!0))):(z.oL=new Ys(z),z.oL.aV=z.IN,K=z.S,K=Fn(K,K.Qu()?z.T4:null,z.Be),jC(5),$s(K,"TYPE","xmlhttp"),PNS(z.oL,K,!1,z.T4,!1))},sYS=function(z,K,f){this.S=1; this.Y=[];this.T=[];this.C=new SC;this.N=z||null;this.W=K!=null?K:null;this.D=f||!1},AO7=function(z,K){this.S=z; this.map=K;this.context=null},jY4=function(z,K,f,M){g.$Z.call(this,"timingevent",z); this.size=K;this.rtt=f;this.retries=M},YxZ=function(z){g.$Z.call(this,"serverreachability",z)},xgo=function(z){z.sY(1,0); z.qf=Fn(z,null,z.Pe);XJ2(z)},Fa7=function(z){z.SQ&&(z.SQ.abort(),z.SQ=null); z.AJ&&(z.AJ.cancel(),z.AJ=null);z.zY&&(g.ZT.clearTimeout(z.zY),z.zY=null);rm(z);z.p7&&(z.p7.cancel(),z.p7=null);z.OU&&(g.ZT.clearTimeout(z.OU),z.OU=null)},O87=function(z,K){if(z.S==0)throw Error("Invalid operation: sending map when state is closed"); z.Y.push(new AO7(z.Lt++,K));z.S!=2&&z.S!=3||XJ2(z)},rOT=function(z){var K=0; z.AJ&&K++;z.p7&&K++;return K},XJ2=function(z){z.p7||z.OU||(z.OU=sV((0,g.p1)(z.LA,z),0),z.GQ=0)},CN_=function(z,K){if(z.S==1){if(!K){z.Mu=Math.floor(Math.random()*1E5); K=z.Mu++;var f=new Ys(z,"",K);f.aV=z.wL;var M=Z84(z),p=z.qf.clone();g.kn(p,"RID",K);g.kn(p,"CVER","1");Zu(z,p);Eio(f,p,M);z.p7=f;z.S=2}}else z.S==3&&(K?oi_(z,K):z.Y.length==0||z.p7||oi_(z))},oi_=function(z,K){if(K)if(z.Af>6){z.Y=z.T.concat(z.Y); z.T.length=0;var f=z.Mu-1;K=Z84(z)}else f=K.G,K=K.Sl;else f=z.Mu++,K=Z84(z);var M=z.qf.clone();g.kn(M,"SID",z.J);g.kn(M,"RID",f);g.kn(M,"AID",z.P0);Zu(z,M);f=new Ys(z,z.J,f,z.GQ+1);f.aV=z.wL;f.setTimeout(1E4+Math.round(1E4*Math.random()));z.p7=f;Eio(f,M,K)},Zu=function(z,K){z.Vc&&(z=z.Vc.Ng())&&g.jS(z,function(f,M){g.kn(K,M,f)})},Z84=function(z){var K=Math.min(z.Y.length,1E3),f=["count="+K]; if(z.Af>6&&K>0){var M=z.Y[0].S;f.push("ofs="+M)}else M=0;for(var p={},t=0;t=3)return!1; z.G++;z.zY=sV((0,g.p1)(z.k7,z),Ugf(z,z.B0));z.B0++;return!0},OV=function(z,K,f){z.S2=z.W==null?f:!z.W; z.CG=K.E_;z.D||xgo(z)},rm=function(z){z.Y4!=null&&(g.ZT.clearTimeout(z.Y4),z.Y4=null)},Ugf=function(z,K){var f=5E3+Math.floor(Math.random()*1E4); z.isActive()||(f*=2);return f*K},oq=function(z,K){if(K==2||K==9){var f=null; z.Vc&&(f=null);var M=(0,g.p1)(z.ize,z);f||(f=new g.vx("//www.google.com/images/cleardot.gif"),K$(f));JO9(f.toString(),1E4,M)}else jC(2);KWS(z,K)},KWS=function(z,K){z.S=0; z.Vc&&z.Vc.rP(K);$J2(z);Fa7(z)},$J2=function(z){z.S=0; z.CG=-1;if(z.Vc)if(z.T.length==0&&z.Y.length==0)z.Vc.Kw();else{var K=g.L1(z.T),f=g.L1(z.Y);z.T.length=0;z.Y.length=0;z.Vc.Kw(K,f)}},Fn=function(z,K,f){var M=g.hy(f); if(M.S!="")K&&g.G$(M,K+"."+M.S),g.b2(M,M.T);else{var p=window.location;M=aQp(p.protocol,K?K+"."+p.hostname:p.hostname,+p.port,f)}z.Vu&&g.jS(z.Vu,function(t,B){g.kn(M,B,t)}); g.kn(M,"VER",z.Af);Zu(z,M);return M},fho=function(){},Ms8=function(){this.S=[]; this.Y=[]},pkT=function(z){g.$Z.call(this,"channelMessage"); this.message=z},ts7=function(z){g.$Z.call(this,"channelError"); this.error=z},BDQ=function(z,K){this.action=z; this.params=K||{}},C$=function(z,K){g.J.call(this); this.S=new g.Kl(this.c9d,0,this);g.d(this,this.S);this.MM=5E3;this.Y=0;if(typeof z==="function")K&&(z=(0,g.p1)(z,K));else if(z&&typeof z.handleEvent==="function")z=(0,g.p1)(z.handleEvent,z);else throw Error("Invalid listener argument");this.T=z},NDp=function(z,K,f,M,p,t,B,v,I,G,b,e,w,D){f=f===void 0?!1:f; M=M===void 0?function(){return""}:M; p=p===void 0?!1:p;t=t===void 0?!1:t;B=B===void 0?!1:B;v=v===void 0?function(){return g.WO({})}:v; I=I===void 0?!1:I;b=b===void 0?!1:b;e=e===void 0?!1:e;w=w===void 0?!1:w;D=D===void 0?!1:D;this.Px=z;this.Y1=K;this.W=new g.Ws;this.Y=new C$(this.gdH,this);this.S=null;this.G=!1;this.N=null;this.nH="";this.l_=this.D=0;this.T=[];this.W1=f;this.eV=M;this.C=t;this.vx=v;this.Bx=G;this.LI=B;this.Hx=null;this.J=g.WO();this.Ft=p;this.nI=I;this.SE=b;this.oa=e;this.Z2=w;this.TP=D;this.VE=new vBf;this.Xc=new IQ4;this.rE=new bJQ;this.b_=new GM1;this.QE=new e89;this.O3=new wg7;this.ra=new DuT},G4p=function(z, K,f,M,p){vKH(z); if(z.S){var t=g.zM("ID_TOKEN"),B=z.S.wL||{};t?B["x-youtube-identity-token"]=t:delete B["x-youtube-identity-token"];z.S.wL=B}Ihp(z);M?(M.getState()!=3&&rOT(M)==0||M.getState(),z.S.connect(K,f,z.Y1,M.J,M.P0)):p?z.S.connect(K,f,z.Y1,p.sessionId,p.arrayId):z.S.connect(K,f,z.Y1)},DJ9=function(z,K){return z.Z2?!0:z.oa?Object.values(bR9).includes(K):z.SE?!Object.values(ex_).includes(K):z.TP?Object.values(wk1).includes(K):!1},hx9=function(z){var K,f; g.n(function(M){if(M.Y==1)return g.u8(M,2),g.l(M,ycf(z),2);g.mS(M);K=z.T;z.T=[];f=K.length;k4f(z,K,f);T_(z);return g.VI(M,0)})},k4f=function(z,K,f){for(var M=0;M0?f=Object.assign({},f,K):delete f.Authorization;z.S.wL=f}},Ihp=function(z){z.Bx&&!z.C&&RxQ(z,z.Bx())},UV=function(z){this.scheme="https"; this.port=this.domain="";this.S="/api/lounge";this.Y=!0;z=z||document.location.href;var K=Number(g.Le(z)[4]||null)||"";K&&(this.port=":"+K);this.domain=g.EW(z)||"";z=g.H4();z.search("MSIE")>=0&&(z=z.match(/MSIE ([\d.]+)/)[1],g.P4(z,"10.0")<0&&(this.Y=!1))},zR=function(z,K){var f=z.S; z.Y&&(f=z.scheme+"://"+z.domain+z.port+z.S);return g.V8(f+K,{})},SnQ=function(z,K){g.kZ.call(this); var f=this;this.Nv=z();this.Nv.subscribe("handlerOpened",this.tX,this);this.Nv.subscribe("handlerClosed",this.onClosed,this);this.Nv.subscribe("handlerError",function(M,p){f.onError(p)}); this.Nv.subscribe("handlerMessage",this.onMessage,this);this.S=K},u$Z=function(z,K,f){var M=this; f=f===void 0?function(){return""}:f; var p=p===void 0?new kNQ:p;var t=t===void 0?new g.Ws:t;this.pathPrefix=z;this.S=K;this.nH=f;this.C=t;this.D=null;this.N=this.G=0;this.channel=null;this.W=0;this.T=new C$(function(){M.T.isActive();var B;((B=M.channel)==null?void 0:F6T((new RWZ(B,B.S)).S.Y))===0&&M.connect(M.D,M.G)}); this.J={};this.Y={};this.Y1=!1;this.logger=null;this.l_=[];this.Pm=void 0;this.vx=new vBf;this.Hx=new IQ4;this.Bx=new GM1;this.eV=new e89},LWf=function(z){g.Ik(z.channel,"m",function(){z.W=3; z.T.reset();z.D=null;z.G=0;for(var K=g.a(z.l_),f=K.next();!f.done;f=K.next())f=f.value,z.channel&&z.channel.send(f);z.l_=[];z.publish("webChannelOpened");z.vx.gh("WEB_CHANNEL")}); g.Ik(z.channel,"n",function(){z.W=0;z.T.isActive()||z.publish("webChannelClosed");var K,f=(K=z.channel)==null?void 0:Sx5(new RWZ(K,K.S));f&&(z.l_=[].concat(g.P(f)));z.Hx.gh("WEB_CHANNEL")}); g.Ik(z.channel,"p",function(K){var f=K.data;f[0]==="gracefulReconnect"?(z.T.start(),z.channel&&z.channel.close()):z.publish("webChannelMessage",new BDQ(f[0],f[1]));z.Pm=K.statusCode;z.Bx.gh("WEB_CHANNEL")}); g.Ik(z.channel,"o",function(){z.Pm===401||z.T.start();z.publish("webChannelError");z.eV.gh("WEB_CHANNEL","")})},EK8=function(z){var K=z.nH(); K?z.J["x-youtube-lounge-xsrf-token"]=K:delete z.J["x-youtube-lounge-xsrf-token"]},Pa_=function(z){g.kZ.call(this); this.S=z();this.S.subscribe("webChannelOpened",this.wC,this);this.S.subscribe("webChannelClosed",this.onClosed,this);this.S.subscribe("webChannelError",this.onError,this);this.S.subscribe("webChannelMessage",this.onMessage,this)},HRZ=function(z,K,f,M,p){function t(){return new NDp(zR(z,"/bc"),K,!1,f,M)} f=f===void 0?function(){return""}:f; return g.Hg("enable_mdx_web_channel_desktop")?new Pa_(function(){return new u$Z(zR(z,"/wc"),K,f)}):new SnQ(t,p)},lhZ=function(){var z=Qsp; qn2();K2.push(z);mJH()},$Q=function(z,K){qn2(); var f=Vs8(z,String(K));K2.length==0?nK5(f):(mJH(),g.co(K2,function(M){M(f)}))},f2=function(z){$Q("CP",z)},qn2=function(){K2||(K2=g.CW("yt.mdx.remote.debug.handlers_")||[],g.ov("yt.mdx.remote.debug.handlers_",K2))},nK5=function(z){var K=(MU+1)%50; MU=K;p2[K]=z;tB||(tB=K==49)},mJH=function(){var z=K2; if(p2[0]){var K=tB?MU:-1,f={};do f={qI:void 0},K=(K+1)%50,f.qI=p2[K],g.co(z,function(M){return function(p){p(M.qI)}}(f)); while(K!=MU);p2=Array(50);MU=-1;tB=!1}},Vs8=function(z,K){var f=(Date.now()-WWZ)/1E3; f.toFixed&&(f=f.toFixed(3));var M=[];M.push("[",f+"s","] ");M.push("[","yt.mdx.remote","] ");M.push(z+": "+K,"\n");return M.join("")},Bb=function(z){g.Dv.call(this); this.W=z;this.screens=[]},JcH=function(z,K){var f=z.get(K.uuid)||z.get(K.id); if(f)return z=f.name,f.id=K.id||f.id,f.name=K.name,f.token=K.token,f.uuid=K.uuid||f.uuid,f.name!=z;z.screens.push(K);return!0},gK1=function(z,K){var f=z.screens.length!=K.length; z.screens=g.ds(z.screens,function(t){return!!TVT(K,t)}); for(var M=K.length,p=0;p0&&z.J0&&R1(z,f)},function(K){z.C=function(){}; z.PW(K)})},GWH=function(z){var K={}; K.pairingCode=z.Hx;K.theme=z.Px;vaf()&&(K.env_useStageMdx=1);return g.l6(K)},bvQ=function(z){return new Promise(function(K){z.Hx=oBZ(); if(z.vx){var f=new chrome.cast.DialLaunchResponse(!0,GWH(z));K(f);Ip8(z)}else z.Y1=function(){g.LJ(z.N);z.Y1=function(){}; z.N=NaN;var M=new chrome.cast.DialLaunchResponse(!0,GWH(z));K(M);Ip8(z)},z.N=g.Sg(function(){z.Y1()},100)})},wLS=function(z,K,f){z.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(K)); var M=new vU(K);return(new Promise(function(p){eq4(z,M,function(t){t?(z.l_=!0,ec(z.J,M),Da(z,M),R1(z,f)):g.fJ(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(K)+" is not online."));p(t)},5)})).then(function(p){return p?new chrome.cast.DialLaunchResponse(!1):bvQ(z)})},D11=function(z,K){var f=z.D.receiver.label,M=z.Y.friendlyName; return(new Promise(function(p){rcf(z.J,f,K,M,function(t){t&&t.token&&Da(z,t);p(t)},function(t){yF(z,"Failed to get DIAL screen: "+t); p(null)})})).then(function(p){return p&&p.token?new chrome.cast.DialLaunchResponse(!1):bvQ(z)})},eq4=function(z,K,f,M){g.LJ(z.W); z.W=0;oK5(z.J,K,function(p){p||M<0?f(p):z.W=g.Sg(function(){eq4(z,K,f,M-1)},300)})},R1=function(z,K){z.info("getDialAppInfoWithTimeout_ "+K); a1(z)&&(g.LJ(z.G),z.G=0,K==0?yY4(z):z.G=g.Sg(function(){yY4(z)},K))},yY4=function(z){a1(z)&&z.T.getDialAppInfo(function(K){z.info("getDialAppInfo dialLaunchData: "+JSON.stringify(K)); K=K.extraData||{};var f=null;if(K.loungeToken){var M;((M=z.S)==null?void 0:M.token)==K.loungeToken&&(f="staleLoungeToken")}else f="missingLoungeToken";f?(z.nH=f,R1(z,3E4)):(z.l_=!1,z.nH="unknown",zq9(z,K.loungeToken),R1(z,K.loungeTokenRefreshIntervalMs))},function(K){z.info("getDialAppInfo error: "+K); z.nH="noLoungeTokenResponse";R1(z,3E4)})},kW4=function(z){g.LJ(z.W); z.W=0;g.LJ(z.G);z.G=0;z.C();z.C=function(){}; g.LJ(z.N)},Sc=function(z,K){wt.call(this,z,K,"ManualSession"); this.T=g.Sg((0,g.p1)(this.Hy,this,null),150)},u3=function(z,K){g.Dv.call(this); this.config_=K;this.Y=z;this.D=K.appId||"233637DE";this.J=K.theme||"cl";this.N=K.disableCastApi||!1;this.W=K.forceMirroring||!1;this.S=null;this.G=!1;this.T=[];this.C=(0,g.p1)(this.gbV,this)},hqT=function(z,K){return K?g.yQ(z.T,function(f){return Iq(K,f.label)},z):null},L2=function(z){$Q("Controller",z)},Qsp=function(z){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(z)},EY=function(z){return z.G||!!z.T.length||!!z.S},Pb=function(z,K,f){K!=z.S&&(g.DO(z.S),(z.S=K)?(f?z.publish("yt-remote-cast2-receiver-resumed", K.Y):z.publish("yt-remote-cast2-receiver-selected",K.Y),K.subscribe("sessionScreen",(0,g.p1)(z.Cj,z,K)),K.subscribe("sessionFailed",function(){return ap_(z,K)}),K.S?z.publish("yt-remote-cast2-session-change",K.S):f&&z.S.Hy(null)):z.publish("yt-remote-cast2-session-change",null))},ap_=function(z,K){z.S==K&&z.publish("yt-remote-cast2-session-failed")},Rqf=function(z){var K=z.Y.yG(),f=z.S&&z.S.Y; z=g.UZ(K,function(M){f&&Iq(M,f.label)&&(f=null);var p=M.uuid?M.uuid:M.id,t=hqT(this,M);t?(t.label=p,t.friendlyName=M.name):(t=new chrome.cast.Receiver(p,M.name),t.receiverType=chrome.cast.ReceiverType.CUSTOM);return t},z); f&&(f.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(f=new chrome.cast.Receiver(f.label,f.friendlyName),f.receiverType=chrome.cast.ReceiverType.CUSTOM),z.push(f));return z},QPp=function(z,K,f,M){M.disableCastApi?Hb("Cannot initialize because disabled by Mdx config."):S2H()?urQ(K,M)&&(Llf(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Eh7(z,f):(window.__onGCastApiAvailable=function(p,t){p?Eh7(z,f):(QF("Failed to load cast API: "+t),Pi4(!1),Llf(!1),g.jp("yt-remote-cast-available"),g.jp("yt-remote-cast-receiver"), Hv4(),f(!1))},M.loadCastApiSetupScript?g.eL("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?b37()>=60&&STZ():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?yV1():b37()>=89?L67():(Rz9(),aq(uH7.map(kC_))))):Hb("Cannot initialize because not running Chrome")},Hv4=function(){Hb("dispose"); var z=qU();z&&z.dispose();g.ov("yt.mdx.remote.cloudview.instance_",null);q28(!1);g.GW(m1S);m1S.length=0},m_=function(){return!!g.AV("yt-remote-cast-installed")},lpf=function(){var z=g.AV("yt-remote-cast-receiver"); return z?z.friendlyName:null},VL7=function(){Hb("clearCurrentReceiver"); g.jp("yt-remote-cast-receiver")},nhS=function(){return m_()?qU()?qU().getCastSession():(QF("getCastSelector: Cast is not initialized."),null):(QF("getCastSelector: Cast API is not installed!"),null)},Wl1=function(){m_()?qU()?l3()?(Hb("Requesting cast selector."),qU().requestSession()):(Hb("Wait for cast API to be ready to request the session."),m1S.push(g.IP("yt-remote-cast2-api-ready",Wl1))):QF("requestCastSelector: Cast is not initialized."):QF("requestCastSelector: Cast API is not installed!")}, VF=function(z,K){l3()?qU().setConnectedScreenStatus(z,K):QF("setConnectedScreenStatus called before ready.")},S2H=function(){var z=g.H4().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.sq||z},JYH=function(z,K){qU().init(z,K)},urQ=function(z,K){var f=!1; qU()||(z=new u3(z,K),z.subscribe("yt-remote-cast2-availability-change",function(M){g.sT("yt-remote-cast-available",M);ks("yt-remote-cast2-availability-change",M)}),z.subscribe("yt-remote-cast2-receiver-selected",function(M){Hb("onReceiverSelected: "+M.friendlyName); g.sT("yt-remote-cast-receiver",M);ks("yt-remote-cast2-receiver-selected",M)}),z.subscribe("yt-remote-cast2-receiver-resumed",function(M){Hb("onReceiverResumed: "+M.friendlyName); g.sT("yt-remote-cast-receiver",M);ks("yt-remote-cast2-receiver-resumed",M)}),z.subscribe("yt-remote-cast2-session-change",function(M){Hb("onSessionChange: "+G_(M)); M||g.jp("yt-remote-cast-receiver");ks("yt-remote-cast2-session-change",M)}),g.ov("yt.mdx.remote.cloudview.instance_",z),f=!0); Hb("cloudview.createSingleton_: "+f);return f},qU=function(){return g.CW("yt.mdx.remote.cloudview.instance_")},Eh7=function(z,K){Pi4(!0); Llf(!1);JYH(z,function(f){f?(q28(!0),g.bi("yt-remote-cast2-api-ready")):(QF("Failed to initialize cast API."),Pi4(!1),g.jp("yt-remote-cast-available"),g.jp("yt-remote-cast-receiver"),Hv4());K(f)})},Hb=function(z){$Q("cloudview",z)},QF=function(z){$Q("cloudview",z)},Pi4=function(z){Hb("setCastInstalled_ "+z); g.sT("yt-remote-cast-installed",z)},l3=function(){return!!g.CW("yt.mdx.remote.cloudview.apiReady_")},q28=function(z){Hb("setApiReady_ "+z); g.ov("yt.mdx.remote.cloudview.apiReady_",z)},Llf=function(z){g.ov("yt.mdx.remote.cloudview.initializing_",z)},n2=function(z){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.W=0;this.trackData=null;this.WC=this.S4=!1;this.D=this.T=this.G=this.Y=0;this.S=NaN;this.J=!1;this.reset(z)},gho=function(z){z.audioTrackId=null; z.trackData=null;z.playerState=-1;z.S4=!1;z.WC=!1;z.W=0;z.C=g.N5();z.Y=0;z.G=0;z.T=0;z.D=0;z.S=NaN;z.J=!1},Wb=function(z){return z.isPlaying()?(g.N5()-z.C)/1E3:0},JB=function(z,K){z.W=K; z.C=g.N5()},gt=function(z){switch(z.playerState){case 1:case 1081:return(g.N5()-z.C)/1E3+z.W; case -1E3:return 0}return z.W},iv4=function(z){return z.J?z.G+Wb(z):z.G},i3=function(z,K,f){var M=z.videoId; z.videoId=K;z.index=f;K!=M&&gho(z)},d1f=function(z){var K={}; K.index=z.index;K.listId=z.listId;K.videoId=z.videoId;K.playerState=z.playerState;K.volume=z.volume;K.muted=z.muted;K.audioTrackId=z.audioTrackId;K.trackData=g.fL(z.trackData);K.hasPrevious=z.S4;K.hasNext=z.WC;K.playerTime=z.W;K.playerTimeAt=z.C;K.seekableStart=z.Y;K.seekableEnd=z.G;K.duration=z.T;K.loadedTime=z.D;K.liveIngestionTime=z.S;return K},cb=function(z,K){g.Dv.call(this); var f=this;this.T=0;this.J=z;this.W=[];this.C=new Ms8;this.Y=this.S=null;this.N=(0,g.p1)(this.Rdh,this);this.G=(0,g.p1)(this.w4,this);this.D=(0,g.p1)(this.wxx,this);this.Y1=(0,g.p1)(this.yLq,this);var M=0;z?(M=z.getProxyState(),M!=3&&(z.subscribe("proxyStateChange",this.rH,this),cY5(this))):M=3;M!=0&&(K?this.rH(M):g.Sg(function(){f.rH(M)},0)); (z=nhS())&&dt(this,z);this.subscribe("yt-remote-cast2-session-change",this.Y1)},sY=function(z){return new n2(z.J.getPlayerContextData())},cY5=function(z){g.co("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(K){this.W.push(this.J.subscribe(K,g.Bo(this.X81,K),this))},z)},sPf=function(z){g.co(z.W,function(K){this.J.unsubscribeByKey(K)},z); z.W.length=0},AB=function(z){return z.getState()==1},jc=function(z,K){var f=z.C; f.S.length+f.Y.length<50&&z.C.enqueue(K)},AY_=function(z,K,f){var M=sY(z); JB(M,f);M.playerState!=-1E3&&(M.playerState=K);YQ(z,M)},XE=function(z,K,f){z.J.sendMessage(K,f)},YQ=function(z,K){sPf(z); z.J.setPlayerContextData(d1f(K));cY5(z)},dt=function(z,K){z.Y&&(z.Y.removeUpdateListener(z.N),z.Y.removeMediaListener(z.G),z.w4(null)); z.Y=K;z.Y&&(f2("Setting cast session: "+z.Y.sessionId),z.Y.addUpdateListener(z.N),z.Y.addMediaListener(z.G),z.Y.media.length&&z.w4(z.Y.media[0]))},jP8=function(z){var K=z.S.media,f=z.S.customData; if(K&&f){var M=sY(z);K.contentId!=M.videoId&&f2("Cast changing video to: "+K.contentId);M.videoId=K.contentId;M.playerState=f.playerState;JB(M,z.S.getEstimatedTime());YQ(z,M)}else f2("No cast media video. Ignoring state update.")},xQ=function(z,K,f){return(0,g.p1)(function(M){this.dI("Failed to "+K+" with cast v2 channel. Error code: "+M.code); M.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.dI("Retrying "+K+" using MDx browser channel."),XE(this,K,f))},z)},rt=function(z,K,f,M){M=M===void 0?!1:M; g.Dv.call(this);var p=this;this.W=NaN;this.Hx=!1;this.N=this.D=this.l_=this.nH=NaN;this.Y1=[];this.C=this.G=this.J=this.S=this.Y=null;this.vx=z;this.Bx=M;this.Y1.push(g.qm(window,"beforeunload",function(){p.zA(2)})); this.T=[];this.S=new n2;this.Px=K.id;this.eV=K.idType;this.Y=HRZ(this.vx,f,this.Y5,this.eV=="shortLived",this.Px);this.Y.listen("channelOpened",function(){Y2p(p)}); this.Y.listen("channelClosed",function(){FE("Channel closed");isNaN(p.W)?Du(!0):Du();p.dispose()}); this.Y.listen("channelError",function(t){Du();isNaN(p.Qg())?(t==1&&p.eV=="shortLived"&&p.publish("browserChannelAuthError",t),FE("Channel error: "+t+" without reconnection"),p.dispose()):(p.Hx=!0,FE("Channel error: "+t+" with reconnection in "+p.Qg()+" ms"),OY(p,2))}); this.Y.listen("channelMessage",function(t){XLp(p,t)}); this.Y.UU(K.token);this.subscribe("remoteQueueChange",function(){var t=p.S.videoId;g.Ya()&&g.sT("yt-remote-session-video-id",t)})},x1S=function(z){return g.yQ(z.T,function(K){return K.type=="LOUNGE_SCREEN"})},FE=function(z){$Q("conn",z)},OY=function(z,K){z.publish("proxyStateChange",K)},Fl_=function(z){z.W=g.Sg(function(){FE("Connecting timeout"); z.zA(1)},2E4)},OvQ=function(z){g.LJ(z.W); z.W=NaN},rYZ=function(z){g.LJ(z.nH); z.nH=NaN},ohH=function(z){ZvT(z); z.l_=g.Sg(function(){Za(z,"getNowPlaying")},2E4)},ZvT=function(z){g.LJ(z.l_); z.l_=NaN},Y2p=function(z){FE("Channel opened"); z.Hx&&(z.Hx=!1,rYZ(z),z.nH=g.Sg(function(){FE("Timing out waiting for a screen.");z.zA(1)},15E3))},TJH=function(z,K){var f=null; if(K){var M=x1S(z);M&&(f={clientName:M.clientName,deviceMake:M.brand,deviceModel:M.model,osVersion:M.osVersion})}g.ov("yt.mdx.remote.remoteClient_",f);K&&(OvQ(z),rYZ(z));f=z.Y.Is()&&isNaN(z.W);K==f?K&&(OY(z,1),Za(z,"getSubtitlesTrack")):K?(z.P4()&&z.S.reset(),OY(z,1),Za(z,"getNowPlaying"),CiH(z)):z.zA(1)},U15=function(z,K){var f=K.params.videoId; delete K.params.videoId;f==z.S.videoId&&(g.U9(K.params)?z.S.trackData=null:z.S.trackData=K.params,z.publish("remotePlayerChange"))},zUT=function(z,K,f){var M=K.params.videoId||K.params.video_id,p=parseInt(K.params.currentIndex,10); z.S.listId=K.params.listId||z.S.listId;i3(z.S,M,p);z.publish("remoteQueueChange",f)},$eS=function(z,K){K.params=K.params||{}; zUT(z,K,"NOW_PLAYING_MAY_CHANGE");KxS(z,K);z.publish("autoplayDismissed")},KxS=function(z,K){var f=parseInt(K.params.currentTime||K.params.current_time,10); JB(z.S,isNaN(f)?0:f);f=parseInt(K.params.state,10);f=isNaN(f)?-1:f;f==-1&&z.S.playerState==-1E3&&(f=-1E3);z.S.playerState=f;f=Number(K.params.loadedTime);z.S.D=isNaN(f)?0:f;z.S.uy(Number(K.params.duration));f=z.S;var M=Number(K.params.liveIngestionTime);f.S=M;f.J=isNaN(M)?!1:!0;f=z.S;M=Number(K.params.seekableStartTime);K=Number(K.params.seekableEndTime);f.Y=isNaN(M)?0:M;f.G=isNaN(K)?0:K;z.S.playerState==1?ohH(z):ZvT(z);z.publish("remotePlayerChange")},f6T=function(z,K){if(z.S.playerState!=-1E3){var f= 1085; switch(parseInt(K.params.adState,10)){case 1:f=1081;break;case 2:f=1084;break;case 0:f=1083}z.S.playerState=f;K=parseInt(K.params.currentTime,10);JB(z.S,isNaN(K)?0:K);z.publish("remotePlayerChange")}},M3_=function(z,K){var f=K.params.muted=="true"; z.S.volume=parseInt(K.params.volume,10);z.S.muted=f;z.publish("remotePlayerChange")},pM_=function(z,K){z.G=K.params.videoId; z.publish("nowAutoplaying",parseInt(K.params.timeout,10))},t38=function(z,K){z.G=K.params.videoId||null; z.publish("autoplayUpNext",z.G)},BxS=function(z,K){z.C=K.params.autoplayMode; z.publish("autoplayModeChange",z.C);z.C=="DISABLED"&&z.publish("autoplayDismissed")},Nx_=function(z,K){var f=K.params.hasNext=="true"; z.S.S4=K.params.hasPrevious=="true";z.S.WC=f;z.publish("previousNextChange")},XLp=function(z,K){K=K.message; K.params?FE("Received: action="+K.action+", params="+g.rB(K.params)):FE("Received: action="+K.action+" {}");switch(K.action){case "loungeStatus":K=f$(K.params.devices);z.T=g.UZ(K,function(M){return new NK(M)}); K=!!g.yQ(z.T,function(M){return M.type=="LOUNGE_SCREEN"}); TJH(z,K);K=z.gt("mlm");z.publish("multiStateLoopEnabled",K);break;case "loungeScreenDisconnected":g.SS(z.T,function(M){return M.type=="LOUNGE_SCREEN"}); TJH(z,!1);break;case "remoteConnected":var f=new NK(f$(K.params.device));g.yQ(z.T,function(M){return M.equals(f)})||pg8(z.T,f); break;case "remoteDisconnected":f=new NK(f$(K.params.device));g.SS(z.T,function(M){return M.equals(f)}); break;case "gracefulDisconnect":break;case "playlistModified":zUT(z,K,"QUEUE_MODIFIED");break;case "nowPlaying":$eS(z,K);break;case "onStateChange":KxS(z,K);break;case "onAdStateChange":f6T(z,K);break;case "onVolumeChanged":M3_(z,K);break;case "onSubtitlesTrackChanged":U15(z,K);break;case "nowAutoplaying":pM_(z,K);break;case "autoplayDismissed":z.publish("autoplayDismissed");break;case "autoplayUpNext":t38(z,K);break;case "onAutoplayModeChanged":BxS(z,K);break;case "onHasPreviousNextChanged":Nx_(z, K);break;case "requestAssistedSignIn":z.publish("assistedSignInRequested",K.params.authCode);break;case "onLoopModeChanged":z.publish("loopModeChange",K.params.loopMode);break;default:FE("Unrecognized action: "+K.action)}},CiH=function(z){g.LJ(z.N); z.N=g.Sg(function(){z.zA(1)},864E5)},Za=function(z,K,f){f?FE("Sending: action="+K+", params="+g.rB(f)):FE("Sending: action="+K); z.Y.sendMessage(K,f)},vTo=function(z){Bb.call(this,"ScreenServiceProxy"); this.z8=z;this.S=[];this.S.push(this.z8.$_s("screenChange",(0,g.p1)(this.Jl,this)));this.S.push(this.z8.$_s("onlineScreenChange",(0,g.p1)(this.QpV,this)))},wMp=function(z,K){N0p(); if(!ys||!ys.get("yt-remote-disable-remote-module-for-dev")){K=g.zM("MDX_CONFIG")||K;UuT();fF5();o1||(o1=new UV(K?K.loungeApiHost:void 0),vaf()&&(o1.S="/api/loungedev"));C2||(C2=g.CW("yt.mdx.remote.deferredProxies_")||[],g.ov("yt.mdx.remote.deferredProxies_",C2));I6o();var f=TR();if(!f){var M=new b3(o1,K?K.disableAutomaticScreenCache||!1:!1);g.ov("yt.mdx.remote.screenService_",M);f=TR();var p={};K&&(p={appId:K.appId,disableDial:K.disableDial,theme:K.theme,loadCastApiSetupScript:K.loadCastApiSetupScript, disableCastApi:K.disableCastApi,enableDialLoungeToken:K.enableDialLoungeToken,enableCastLoungeToken:K.enableCastLoungeToken,forceMirroring:K.forceMirroring});g.ov("yt.mdx.remote.enableConnectWithInitialState_",K?K.enableConnectWithInitialState||!1:!1);QPp(z,M,function(t){t?UY()&&VF(UY(),"YouTube TV"):M.subscribe("onlineScreenChange",function(){ks("yt-remote-receiver-availability-change")})},p)}K&&!g.CW("yt.mdx.remote.initialized_")&&(g.ov("yt.mdx.remote.initialized_",!0),zb("Initializing: "+g.rB(K)), KB.push(g.IP("yt-remote-cast2-api-ready",function(){ks("yt-remote-api-ready")})),KB.push(g.IP("yt-remote-cast2-availability-change",function(){ks("yt-remote-receiver-availability-change")})),KB.push(g.IP("yt-remote-cast2-receiver-selected",function(){$G(null); ks("yt-remote-auto-connect","cast-selector-receiver")})),KB.push(g.IP("yt-remote-cast2-receiver-resumed",function(){ks("yt-remote-receiver-resumed","cast-selector-receiver")})),KB.push(g.IP("yt-remote-cast2-session-change",Guo)),KB.push(g.IP("yt-remote-connection-change",function(t){t?VF(UY(),"YouTube TV"):fB()||(VF(null,null),VL7())})),KB.push(g.IP("yt-remote-cast2-session-failed",function(){ks("yt-remote-connection-failed")})),z=bQ5(),K.isAuto&&(z.id+="#dial"),p=K.capabilities||[],p.length>0&&(z.capabilities= p),z.name=K.device,z.app=K.app,(K=K.theme)&&(z.theme=K),zb(" -- with channel params: "+g.rB(z)),z?(g.sT("yt-remote-session-app",z.app),g.sT("yt-remote-session-name",z.name)):(g.jp("yt-remote-session-app"),g.jp("yt-remote-session-name")),g.ov("yt.mdx.remote.channelParams_",z),f.start(),UY()||eUS())}},DeH=function(){var z=TR().z8.$_gos(); var K=MF();K&&pB()&&(TVT(z,K)||z.push(K));return Cm5(z)},ku_=function(){var z=yl2(); !z&&m_()&&lpf()&&(z={key:"cast-selector-receiver",name:lpf()});return z},yl2=function(){var z=DeH(),K=MF(); K||(K=fB());return g.yQ(z,function(f){return K&&Iq(K,f.key)?!0:!1})},MF=function(){var z=UY(); if(!z)return null;var K=TR().xm();return bO(K,z)},Guo=function(z){zb("remote.onCastSessionChange_: "+G_(z)); if(z){var K=MF();if(K&&K.id==z.id){if(VF(K.id,"YouTube TV"),z.idType=="shortLived"&&(z=z.token))t7&&(t7.token=z),(K=pB())&&K.UU(z)}else K&&By(),NF(z,1)}else pB()&&By()},By=function(){l3()?qU().stopSession():QF("stopSession called before API ready."); var z=pB();z&&(z.disconnect(1),hU5(null))},a69=function(){var z=pB(); return!!z&&z.getProxyState()!=3},zb=function(z){$Q("remote",z)},TR=function(){if(!RU2){var z=g.CW("yt.mdx.remote.screenService_"); RU2=z?new vTo(z):null}return RU2},UY=function(){return g.CW("yt.mdx.remote.currentScreenId_")},Sm7=function(z){g.ov("yt.mdx.remote.currentScreenId_",z)},uXH=function(){return g.CW("yt.mdx.remote.connectData_")},$G=function(z){g.ov("yt.mdx.remote.connectData_",z)},pB=function(){return g.CW("yt.mdx.remote.connection_")},hU5=function(z){var K=pB(); $G(null);z||Sm7("");g.ov("yt.mdx.remote.connection_",z);C2&&(g.co(C2,function(f){f(z)}),C2.length=0); K&&!z?ks("yt-remote-connection-change",!1):!K&&z&&ks("yt-remote-connection-change",!0)},fB=function(){var z=g.Ya(); if(!z)return null;var K=TR();if(!K)return null;K=K.xm();return bO(K,z)},NF=function(z,K){UY(); MF()&&MF();if(vy)t7=z;else{Sm7(z.id);var f=g.CW("yt.mdx.remote.enableConnectWithInitialState_")||!1;z=new rt(o1,z,bQ5(),f);z.connect(K,uXH());z.subscribe("beforeDisconnect",function(M){ks("yt-remote-before-disconnect",M)}); z.subscribe("beforeDispose",function(){pB()&&(pB(),hU5(null))}); z.subscribe("browserChannelAuthError",function(){var M=MF();M&&M.idType=="shortLived"&&(l3()?qU().handleBrowserChannelAuthError():QF("refreshLoungeToken called before API ready."))}); hU5(z)}},eUS=function(){var z=fB(); z?(zb("Resume connection to: "+G_(z)),NF(z,0)):(Du(),VL7(),zb("Skipping connecting because no session screen found."))},I6o=function(){var z=bQ5(); if(g.U9(z)){z=wm();var K=g.AV("yt-remote-session-name")||"",f=g.AV("yt-remote-session-app")||"";z={device:"REMOTE_CONTROL",id:z,name:K,app:f,mdxVersion:3};z.authuser=String(g.zM("SESSION_INDEX","0"));(K=g.zM("DELEGATED_SESSION_ID"))&&(z.pageId=String(K));g.ov("yt.mdx.remote.channelParams_",z)}},bQ5=function(){return g.CW("yt.mdx.remote.channelParams_")||{}},PcZ=function(z,K,f){g.J.call(this); var M=this;this.S=z;this.U=K;this.AB=f;this.events=new g.xI(this);this.C=!1;this.W=new g.ex(64);this.Y=new g.Kl(this.Yj,500,this);this.T=new g.Kl(this.lV,1E3,this);this.D=new Rq(this.aXa,0,this);this.J={};this.N=new g.Kl(this.qe,1E3,this);this.G=new g.Bs(this.seekTo,1E3,this);this.Y1=this.events.X(this.U,"onVolumeChange",function(p){Lx5(M,p)}); g.d(this,this.events);this.events.X(K,"onCaptionsTrackListChanged",this.Bac);this.events.X(K,"captionschanged",this.rLf);this.events.X(K,"captionssettingschanged",this.hp);this.events.X(K,"videoplayerreset",this.Jm);this.events.X(K,"mdxautoplaycancel",function(){M.AB.ZV()}); K.B("enable_mdx_video_play_directly")&&this.events.X(K,"videodatachange",function(){ETQ(M.S)||IL(M)||Gb(M,0)}); z=this.AB;z.CH();z.subscribe("proxyStateChange",this.Wt,this);z.subscribe("remotePlayerChange",this.AR,this);z.subscribe("remoteQueueChange",this.Jm,this);z.subscribe("previousNextChange",this.Ht,this);z.subscribe("nowAutoplaying",this.Eq,this);z.subscribe("autoplayDismissed",this.sB,this);g.d(this,this.Y);g.d(this,this.T);g.d(this,this.D);g.d(this,this.N);g.d(this,this.G);this.hp();this.Jm();this.AR()},Lx5=function(z,K){if(IL(z)){z.AB.unsubscribe("remotePlayerChange",z.AR,z); var f=Math.round(K.volume);K=!!K.muted;var M=sY(z.AB);if(f!==M.volume||K!==M.muted)z.AB.setVolume(f,K),z.N.start();z.AB.subscribe("remotePlayerChange",z.AR,z)}},HQ9=function(z){z.C6(0); z.Y.stop();z.p6(new g.ex(64))},Q22=function(z,K){if(IL(z)&&!z.C){var f=null; K&&(f={style:z.U.getSubtitlesUserSettings()},Object.assign(f,K));z.AB.Ay(z.U.getVideoData(1).videoId,f);z.J=sY(z.AB).trackData}},Gb=function(z,K){var f=z.U.getPlaylist(); if(f==null?0:f.listId){var M=f.index;var p=f.listId.toString()}f=z.U.getVideoData(1);z.AB.playVideo(f.videoId,K,M,p,f.playerParams,f.vx,Mg7(f));z.p6(new g.ex(1))},qmQ=function(z,K){if(K){var f=z.U.getOption("captions","tracklist",{m2:1}); f&&f.length?(z.U.setOption("captions","track",K),z.C=!1):(z.U.loadModule("captions"),z.C=!0)}else z.U.setOption("captions","track",{})},IL=function(z){return sY(z.AB).videoId===z.U.getVideoData(1).videoId},meS=function(z,K){g.j0.call(this,z); this.S=K},b0=function(){g.F.call(this,{j:"div", K:"ytp-mdx-popup-dialog",V:{role:"dialog"},L:[{j:"div",K:"ytp-mdx-popup-dialog-inner-content",L:[{j:"div",K:"ytp-mdx-popup-title",qc:"B\u1ea1n \u0111\u00e3 \u0111\u0103ng xu\u1ea5t"},{j:"div",K:"ytp-mdx-popup-description",qc:"C\u00e1c video m\u00e0 b\u1ea1n xem c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c th\u00eam v\u00e0o nh\u1eadt k\u00fd xem v\u00e0 g\u00e2y \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn ph\u1ea7n \u0111\u1ec1 xu\u1ea5t tr\u00ean TV. \u0110\u1ec3 tr\u00e1nh \u0111i\u1ec1u n\u00e0y, h\u00e3y h\u1ee7y r\u1ed3i \u0111\u0103ng nh\u1eadp v\u00e0o YouTube tr\u00ean m\u00e1y t\u00ednh."}, {j:"div",K:"ytp-mdx-privacy-popup-buttons",L:[{j:"button",Wx:["ytp-button","ytp-mdx-privacy-popup-cancel"],qc:"H\u1ee7y"},{j:"button",Wx:["ytp-button","ytp-mdx-privacy-popup-confirm"],qc:"X\u00e1c nh\u1eadn"}]}]}]});this.fade=new g.I3(this,250);this.cancelButton=this.dE("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.dE("ytp-mdx-privacy-popup-confirm");g.d(this,this.fade);this.X(this.cancelButton,"click",this.S);this.X(this.confirmButton,"click",this.Y)},eD=function(z){g.F.call(this,{j:"div", K:"ytp-remote",L:[{j:"div",K:"ytp-remote-display-status",L:[{j:"div",K:"ytp-remote-display-status-icon",L:[g.wJ8()]},{j:"div",K:"ytp-remote-display-status-text",qc:"{{statustext}}"}]}]});this.api=z;this.fade=new g.I3(this,250);g.d(this,this.fade);this.X(z,"presentingplayerstatechange",this.onStateChange);this.Xr(z.getPlayerStateObject())},wO=function(z,K){g.iP.call(this,"Ph\u00e1t tr\u00ean",1,z,K); this.U=z;this.hF={};this.X(z,"onMdxReceiversChange",this.J);this.X(z,"presentingplayerstatechange",this.J);this.J()},l68=function(z){g.R5.call(this,z); this.j4={key:oBZ(),name:"M\u00e1y t\u00ednh n\u00e0y"};this.ly=null;this.subscriptions=[];this.rg=this.AB=null;this.hF=[this.j4];this.Ya=this.j4;this.Dv=new g.ex(64);this.sb=0;this.lj=-1;this.cR=!1;this.qM=this.hR=this.JQ=null;if(!g.jo(this.player.Z())&&!g.O$(this.player.Z())){z=this.player;var K=g.aN(z);K&&(K=K.Hc())&&(K=new wO(z,K),g.d(this,K));K=new eD(z);g.d(this,K);g.dq(z,K.element,4);this.JQ=new b0;g.d(this,this.JQ);g.dq(z,this.JQ.element,4);this.cR=!!fB()}},Dm=function(z){z.hR&&(z.player.removeEventListener("presentingplayerstatechange", z.hR),z.hR=null)},V3Q=function(z,K,f){z.Dv=f; z.player.publish("presentingplayerstatechange",new g.S$(f,K))},yK=function(z,K){if(K.key!==z.Ya.key)if(K.key===z.j4.key)By(); else if(ETQ(z)&&nT9(z),z.Ya=K,!z.player.Z().B("disable_mdx_connection_in_mdx_module_for_music_web")||!g.O$(z.player.Z())){var f=z.player.getPlaylistId();var M=z.player.getVideoData(1);var p=M.videoId;if(!f&&!p||(z.player.getAppState()===2||z.player.getAppState()===1)&&z.player.Z().B("should_clear_video_data_on_player_cued_unstarted"))M=null;else{var t=z.player.getPlaylist();if(t){var B=[];for(var v=0;v2*this.size&&BU(this),!0):!1}; g.k.get=function(z,K){return p$(this.Y,z)?this.Y[z]:K}; g.k.set=function(z,K){p$(this.Y,z)||(this.size+=1,this.S.push(z),this.tF++);this.Y[z]=K}; g.k.forEach=function(z,K){for(var f=this.Kd(),M=0;M=M.S.length)return g.vQ;var t=M.S[K++];return g.W2(z?t:M.Y[t])}; return p}; var PmS={j1L:"atp",bYE:"ska",zsq:"que",Wux:"mus",M1h:"sus",yeL:"dsp",B_a:"seq",pCh:"mic",nv1:"dpa",cDf:"mlm",Eva:"dsdtr",KuE:"ntb",Fhc:"vsp",Ihe:"scn",pEa:"rpe",lhE:"dcn",T2E:"dcp",sHc:"pas",Jeq:"drq",uGh:"opf",vvL:"els",mrE:"isg",FzE:"svq",UCH:"mvp",UZa:"ads",y0c:"stcp",u_H:"sads",qo1:"dloc",drd:"dcw"},HJo={Kh1:"u",DME:"cl",kUL:"k",H7E:"i",RGV:"cr",mCc:"m",OWH:"g",ME:"up"},bR9={D_:"adPlaying",ih:"onAdStateChange"},ex_={Fud:"nowPlaying",fEe:"onStateChange",D_:"adPlaying",ih:"onAdStateChange",P6:"nowPlayingShorts", Fd:"onShortsStateChange"},wk1={P6:"nowPlayingShorts",Fd:"onShortsStateChange"};NK.prototype.equals=function(z){return z?this.id==z.id:!1}; var $m4="",ys=null;IF9.prototype.flush=function(z,K){z=z===void 0?[]:z;K=K===void 0?!1:K;if(g.Hg("enable_client_streamz_web")){z=g.a(z);for(var f=z.next();!f.done;f=z.next())f=g.Uru(f.value),this.S&&g.CP(f,Kw9,2,this.S),f={serializedIncrementBatch:g.NW(f.T())},g.Ds("streamzIncremented",f,{sendIsolatedPayload:K})}}; g.h(GCf,IF9);var h_,aFH=ez9("loadCastFramework")||ez9("loadCastApplicationFramework"),uH7=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.GH(Rq,g.J);g.k=Rq.prototype;g.k.gC=function(z){this.J=arguments;this.S=!1;this.gO?this.T=g.N5()+this.MM:this.gO=g.Xu(this.C,this.MM)}; g.k.stop=function(){this.gO&&(g.ZT.clearTimeout(this.gO),this.gO=null);this.T=null;this.S=!1;this.J=[]}; g.k.pause=function(){++this.Y}; g.k.resume=function(){this.Y&&(--this.Y,!this.Y&&this.S&&(this.S=!1,this.W.apply(null,this.J)))}; g.k.JL=function(){this.stop();Rq.Y9.JL.call(this)}; g.k.ZP=function(){this.gO&&(g.ZT.clearTimeout(this.gO),this.gO=null);this.T?(this.gO=g.Xu(this.C,this.T-g.N5()),this.T=null):this.Y?this.S=!0:(this.S=!1,this.W.apply(null,this.J))};SC.prototype.stringify=function(z){return g.ZT.JSON.stringify(z,void 0)}; SC.prototype.parse=function(z){return g.ZT.JSON.parse(z,void 0)};g.GH(Ea1,g.$Z);g.GH(Pu8,g.$Z);var H38=null;g.GH(qTp,g.$Z);g.GH(mmS,g.$Z);g.GH(lFQ,g.$Z);PU.prototype.debug=function(){}; PU.prototype.info=function(){}; PU.prototype.warning=function(){};var cVZ={},dmT={};g.k=HU.prototype;g.k.setTimeout=function(z){this.rE=z}; g.k.Q3=function(z){z=z.target;var K=this.QE;K&&g.zh(z)==3?K.z4():this.KA(z)}; g.k.KA=function(z){try{if(z==this.S)a:{var K=g.zh(this.S),f=this.S.Y,M=this.S.getStatus();if(!(K<3)&&(K!=3||this.S&&(this.Y.Y||g.$V(this.S)||g.fV(this.S)))){this.Bx||K!=4||f==7||(f==8||M<=0?uO(3):uO(2));jZQ(this);var p=this.S.getStatus();this.TP=p;var t=i3o(this);if(this.W=p==200){if(this.nI&&!this.Xc){b:{if(this.S){var B=g.MY(this.S,"X-HTTP-Initial-Response");if(B&&!g.h6(B)){var v=B;break b}}v=null}if(z=v)this.Xc=!0,Cu9(this,z);else{this.W=!1;this.C=3;L$(12);qK(this);mX(this);break a}}if(this.eV){z= !0;for(var I;!this.Bx&&this.G0&&!this.W1&&(this.W1=!0,this.T.Az(this)):(qK(this),mX(this))}else Cu9(this,t);K==4&&qK(this);this.W&&!this.Bx&&(K==4?YTS(this.T,this):(this.W=!1,Qs(this)))}else g.uZo(this.S),p==400&&t.indexOf("Unknown SID")> 0?(this.C=3,L$(12)):(this.C=0,L$(13)),qK(this),mX(this)}}}catch(G){}finally{}}; g.k.cancel=function(){this.Bx=!0;qK(this)}; g.k.OY=function(){this.Y1=null;var z=Date.now();z-this.oa>=0?(this.Px!=2&&(uO(3),L$(17)),qK(this),this.C=2,mX(this)):AVH(this,this.oa-z)}; g.k.getLastError=function(){return this.C}; g.k.eJ=function(){return this.S};Um_.prototype.cancel=function(){this.T=Kaf(this);if(this.Y)this.Y.cancel(),this.Y=null;else if(this.S&&this.S.size!==0){for(var z=g.a(this.S.values()),K=z.next();!K.done;K=z.next())K.value.cancel();this.S.clear()}};g.k=tOo.prototype;g.k.ir=8;g.k.Qc=1;g.k.connect=function(z,K,f,M){L$(0);this.Ft=z;this.Bx=K||{};f&&M!==void 0&&(this.Bx.OSID=f,this.Bx.OAID=M);this.Xc=this.Z2;this.vx=rV9(this,null,this.Ft);WU(this)}; g.k.disconnect=function(){Ng9(this);if(this.Qc==3){var z=this.b_++,K=this.vx.clone();g.kn(K,"SID",this.J);g.kn(K,"RID",z);g.kn(K,"TYPE","terminate");iO(this,K);z=new HU(this,this.J,z);z.Px=2;z.D=K$(K.clone());K=!1;if(g.ZT.navigator&&g.ZT.navigator.sendBeacon)try{K=g.ZT.navigator.sendBeacon(z.D.toString(),"")}catch(f){}!K&&g.ZT.Image&&((new Image).src=z.D,K=!0);K||(z.S=JV9(z.T,null),z.S.send(z.D));z.nH=Date.now();Qs(z)}wJ_(this)}; g.k.rI=function(){return this.Qc==0}; g.k.getState=function(){return this.Qc}; g.k.XU=function(z){if(this.W)if(this.W=null,this.Qc==1){if(!z){this.b_=Math.floor(Math.random()*1E5);z=this.b_++;var K=new HU(this,"",z),f=this.N;this.TP&&(f?(f=g.$o(f),g.Mn(f,this.TP)):f=this.TP);this.G!==null||this.oa||(K.vx=f,f=null);var M;if(this.SE)a:{for(var p=M=0;p4096){M=p;break a}if(M===4096||p===this.T.length-1){M=p+1;break a}}M= 1E3}else M=1E3;M=GNT(this,K,M);p=this.vx.clone();g.kn(p,"RID",z);g.kn(p,"CVER",22);this.eV&&g.kn(p,"X-HTTP-Session-Id",this.eV);iO(this,p);f&&(this.oa?M="headers="+g.Dy(g.AbS(f))+"&"+M:this.G&&g.SP(p,this.G,f));O37(this.Y,K);this.FK&&g.kn(p,"TYPE","init");this.SE?(g.kn(p,"$req",M),g.kn(p,"SID","null"),K.nI=!0,W61(K,p,null)):W61(K,p,M);this.Qc=2}}else this.Qc==3&&(z?b8H(this,z):this.T.length==0||zW4(this.Y)||b8H(this))}; g.k.FU=function(){this.D=null;eW9(this);if(this.O3&&!(this.rE||this.S==null||this.E0<=0)){var z=2*this.E0;this.Hx=EV((0,g.p1)(this.LeV,this),z)}}; g.k.LeV=function(){this.Hx&&(this.Hx=null,this.Xc=!1,this.rE=!0,L$(10),Vs(this),eW9(this))}; g.k.Az=function(z){this.S==z&&this.O3&&!this.rE&&(BgZ(this),this.rE=!0,L$(11))}; g.k.V3=function(){this.Y1!=null&&(this.Y1=null,Vs(this),xmf(this),L$(19))}; g.k.Fad=function(z){z?L$(2):L$(1)}; g.k.isActive=function(){return!!this.C&&this.C.isActive(this)}; g.k=yOo.prototype;g.k.Zd=function(){}; g.k.fA=function(){}; g.k.gP=function(){}; g.k.Dd=function(){}; g.k.isActive=function(){return!0}; g.k.MY=function(){};g.GH(cU,g.kZ);cU.prototype.open=function(){this.S.C=this.T;this.W&&(this.S.Px=!0);this.S.connect(this.C,this.Y||void 0)}; cU.prototype.close=function(){this.S.disconnect()}; cU.prototype.send=function(z){var K=this.S;if(typeof z==="string"){var f={};f.__data__=z;z=f}else this.J&&(f={},f.__data__=g.rB(z),z=f);K.T.push(new T0S(K.PA++,z));K.Qc==3&&WU(K)}; cU.prototype.JL=function(){this.S.C=null;delete this.T;this.S.disconnect();delete this.S;cU.Y9.JL.call(this)}; g.GH(hWH,Ea1);g.GH(aso,Pu8);g.GH(dm,yOo);dm.prototype.Zd=function(){this.S.dispatchEvent("m")}; dm.prototype.fA=function(z){this.S.dispatchEvent(new hWH(z))}; dm.prototype.gP=function(z){this.S.dispatchEvent(new aso(z))}; dm.prototype.Dd=function(){this.S.dispatchEvent("n")};var A_=new g.kZ;g.h(uQT,g.$Z);g.k=Ys.prototype;g.k.aV=null;g.k.ZK=!1;g.k.CR=null;g.k.We=null;g.k.OZ=null;g.k.AS=null;g.k.gG=null;g.k.Sc=null;g.k.Sl=null;g.k.qr=null;g.k.lk=0;g.k.fM=null;g.k.YB=null;g.k.oV=null;g.k.Zc=-1;g.k.iF=!0;g.k.fl=!1;g.k.Un=0;g.k.oC=null;var qxT={},QY7={};g.k=Ys.prototype;g.k.setTimeout=function(z){this.Y=z}; g.k.bf=function(z){z=z.target;var K=this.oC;K&&g.zh(z)==3?K.z4():this.Oa(z)}; g.k.Oa=function(z){try{if(z==this.qr)a:{var K=g.zh(this.qr),f=this.qr.Y,M=this.qr.getStatus();if(g.oz&&!g.Qw("420+")){if(K<4)break a}else if(K<3||K==3&&!g.$V(this.qr))break a;this.fl||K!=4||f==7||(f==8||M<=0?this.S.Rb(3):this.S.Rb(2));VOZ(this);var p=this.qr.getStatus();this.Zc=p;var t=g.$V(this.qr);if(this.ZK=p==200){K==4&&Xn(this);if(this.eV){for(z=!0;!this.fl&&this.lk0?(this.oV=3,jC(13)):(this.oV=0,jC(14)),Xn(this),ni1(this)}}catch(v){}finally{}}; g.k.cancel=function(){this.fl=!0;Xn(this)}; g.k.kE=function(){this.CR=null;var z=Date.now();z-this.We>=0?(this.AS!=2&&this.S.Rb(3),Xn(this),this.oV=2,jC(18),ni1(this)):ls1(this,this.We-z)}; g.k.getLastError=function(){return this.oV};g.k=i8S.prototype;g.k.IN=null;g.k.oL=null;g.k.f_=!1;g.k.Be=null;g.k.tD=null;g.k.E_=-1;g.k.T4=null;g.k.FE=null;g.k.connect=function(z){this.Be=z;z=Fn(this.S,null,this.Be);jC(3);Date.now();var K=this.S.N;K!=null?(this.T4=K[0],(this.FE=K[1])?(this.tD=1,dg9(this)):(this.tD=2,cO9(this))):($s(z,"MODE","init"),this.oL=new Ys(this),this.oL.aV=this.IN,PNS(this.oL,z,!1,null,!0),this.tD=0)}; g.k.Ih=function(z){if(z)this.tD=2,cO9(this);else{jC(4);var K=this.S;K.CG=K.SQ.E_;oq(K,9)}z&&this.Rb(2)}; g.k.mK=function(z){return this.S.mK(z)}; g.k.abort=function(){this.oL&&(this.oL.cancel(),this.oL=null);this.E_=-1}; g.k.rI=function(){return!1}; g.k.QG=function(z,K){this.E_=z.Zc;if(this.tD==0)if(K){try{var f=this.Y.parse(K)}catch(M){z=this.S;z.CG=this.E_;oq(z,2);return}this.T4=f[0];this.FE=f[1]}else z=this.S,z.CG=this.E_,oq(z,2);else this.tD==2&&(this.f_?(jC(7),Date.now()):K=="11111"?(jC(6),this.f_=!0,Date.now(),this.E_=200,this.oL.cancel(),jC(12),OV(this.S,this,!0)):(jC(8),Date.now(),this.f_=!1))}; g.k.Cw=function(){this.E_=this.oL.Zc;if(this.oL.ZK)this.tD==0?this.FE?(this.tD=1,dg9(this)):(this.tD=2,cO9(this)):this.tD==2&&(this.f_?(jC(12),OV(this.S,this,!0)):(jC(11),OV(this.S,this,!1)));else{this.tD==0?jC(9):this.tD==2&&jC(10);var z=this.S;this.oL.getLastError();z.CG=this.E_;oq(z,2)}}; g.k.Qu=function(){return this.S.Qu()}; g.k.isActive=function(){return this.S.isActive()}; g.k.Rb=function(z){this.S.Rb(z)};g.k=sYS.prototype;g.k.wL=null;g.k.Vu=null;g.k.p7=null;g.k.AJ=null;g.k.Pe=null;g.k.qf=null;g.k.VG=null;g.k.G_=null;g.k.Mu=0;g.k.Lt=0;g.k.Vc=null;g.k.OU=null;g.k.zY=null;g.k.Y4=null;g.k.SQ=null;g.k.S2=null;g.k.P0=-1;g.k.Mg=-1;g.k.CG=-1;g.k.GQ=0;g.k.B0=0;g.k.Af=8;var WxT={OK:0,x2f:2,lEh:4,XCe:5,PBe:6,STOP:7,Gv:8,hGf:9,Hbe:10,xMV:11,WMx:12};g.GH(jY4,g.$Z);g.GH(YxZ,g.$Z);g.k=sYS.prototype; g.k.connect=function(z,K,f,M,p){jC(0);this.Pe=K;this.Vu=f||{};M&&p!==void 0&&(this.Vu.OSID=M,this.Vu.OAID=p);this.D?(sV((0,g.p1)(this.je,this,z),100),xgo(this)):this.je(z)}; g.k.disconnect=function(){Fa7(this);if(this.S==3){var z=this.Mu++,K=this.qf.clone();g.kn(K,"SID",this.J);g.kn(K,"RID",z);g.kn(K,"TYPE","terminate");Zu(this,K);z=new Ys(this,this.J,z);z.AS=2;z.gG=K$(K.clone());(new Image).src=z.gG.toString();z.OZ=Date.now();H8Z(z)}$J2(this)}; g.k.je=function(z){this.SQ=new i8S(this);this.SQ.IN=this.wL;this.SQ.Y=this.C;this.SQ.connect(z)}; g.k.rI=function(){return this.S==0}; g.k.getState=function(){return this.S}; g.k.LA=function(z){this.OU=null;CN_(this,z)}; g.k.k7=function(){this.zY=null;this.AJ=new Ys(this,this.J,"rpc",this.G);this.AJ.aV=this.wL;this.AJ.Un=0;var z=this.VG.clone();g.kn(z,"RID","rpc");g.kn(z,"SID",this.J);g.kn(z,"CI",this.S2?"0":"1");g.kn(z,"AID",this.P0);Zu(this,z);g.kn(z,"TYPE","xmlhttp");PNS(this.AJ,z,!0,this.G_,!1)}; g.k.QG=function(z,K){if(this.S!=0&&(this.AJ==z||this.p7==z))if(this.CG=z.Zc,this.p7==z&&this.S==3)if(this.Af>7){try{var f=this.C.parse(K)}catch(M){f=null}if(Array.isArray(f)&&f.length==3)if(z=f,z[0]==0)a:{if(!this.zY){if(this.AJ)if(this.AJ.OZ+3E30)){if(M=K==1)this.p7||this.OU||this.S==1||this.GQ>=2?M=!1:(this.OU=sV((0,g.p1)(this.LA,this,z),Ugf(this,this.GQ)),this.GQ++, M=!0);M=!(M||K==2&&zxp(this))}if(M)switch(f){case 1:oq(this,5);break;case 4:oq(this,10);break;case 3:oq(this,6);break;case 7:oq(this,12);break;default:oq(this,2)}}}; g.k.sY=function(z){if(!g.h2(arguments,this.S))throw Error("Unexpected channel state: "+this.S);}; g.k.ize=function(z){z?jC(2):(jC(1),KWS(this,8))}; g.k.mK=function(z){if(z)throw Error("Can't create secondary domain capable XhrIo object.");z=new g.Cr;z.G=!1;return z}; g.k.isActive=function(){return!!this.Vc&&this.Vc.isActive(this)}; g.k.Rb=function(z){var K=A_;K.dispatchEvent(new YxZ(K,z))}; g.k.Qu=function(){return!1}; g.k=fho.prototype;g.k.wP=function(){}; g.k.t2=function(){}; g.k.RY=function(){}; g.k.rP=function(){}; g.k.Kw=function(){}; g.k.Ng=function(){return{}}; g.k.isActive=function(){return!0};g.k=Ms8.prototype;g.k.enqueue=function(z){this.Y.push(z)}; g.k.isEmpty=function(){return this.S.length===0&&this.Y.length===0}; g.k.clear=function(){this.S=[];this.Y=[]}; g.k.contains=function(z){return g.h2(this.S,z)||g.h2(this.Y,z)}; g.k.remove=function(z){var K=this.S;var f=(0,g.d82)(K,z);f>=0?(g.a8(K,f),K=!0):K=!1;return K||g.R8(this.Y,z)}; g.k.xq=function(){for(var z=[],K=this.S.length-1;K>=0;--K)z.push(this.S[K]);K=this.Y.length;for(var f=0;f=Jl8.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(z=Jl8[this.Y],this.gO=g.Sg((0,g.p1)(this.No,this),z),this.Y++):this.publish("pairingFailed",Error("Server error "+z.status))}; g.k.aB=function(){this.S=null;this.publish("pairingFailed",Error("Server not responding"))}; var Jl8=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.GH(vb,Bb);g.k=vb.prototype;g.k.start=function(){NU(this)&&this.publish("screenChange");!g.AV("yt-remote-lounge-token-expiration")&&cco(this);g.LJ(this.S);this.S=g.Sg((0,g.p1)(this.start,this),1E4)}; g.k.add=function(z,K){NU(this);JcH(this,z);I1(this,!1);this.publish("screenChange");K(z);z.token||cco(this)}; g.k.remove=function(z,K){var f=NU(this);iRo(this,z)&&(I1(this,!1),f=!0);K(z);f&&this.publish("screenChange")}; g.k.Rr=function(z,K,f,M){var p=NU(this),t=this.get(z.id);t?(t.name!=K&&(t.name=K,I1(this,!1),p=!0),f(z)):M(Error("no such local screen."));p&&this.publish("screenChange")}; g.k.JL=function(){g.LJ(this.S);vb.Y9.JL.call(this)}; g.k.Ol=function(z){NU(this);var K=this.screens.length;z=z&&z.screens||[];for(var f=z.length,M=0;M20)break a;v=K(t,B)}t=v}p.name=t}f(ec(this,p))},this), onError:(0,g.p1)(function(p){M(Error("pairing request failed: "+p.status))},this), onTimeout:(0,g.p1)(function(){M(Error("pairing request timed out."))},this)})}; g.k.JL=function(){g.DO(this.Y);g.DO(this.S);b3.Y9.JL.call(this)}; g.k.Rl=function(){CaS(this);this.publish("screenChange");this.S.update()}; b3.prototype.dispose=b3.prototype.dispose;g.GH(wt,g.Dv);g.k=wt.prototype;g.k.PW=function(z){this.CH()||(z&&(yF(this,""+z),this.publish("sessionFailed")),this.S=null,this.publish("sessionScreen",null))}; g.k.info=function(z){$Q(this.eV,z)}; g.k.oY=function(){return null}; g.k.M4=function(z){var K=this.Y;z?(K.displayStatus=new chrome.cast.ReceiverDisplayStatus(z,[]),K.displayStatus.showStop=!0):K.displayStatus=null;chrome.cast.setReceiverDisplayStatus(K,(0,g.p1)(function(){this.info("Updated receiver status for "+K.friendlyName+": "+z)},this),(0,g.p1)(function(){yF(this,"Failed to update receiver status for: "+K.friendlyName)},this))}; g.k.JL=function(){this.M4("");wt.Y9.JL.call(this)};g.h(kQ,wt);g.k=kQ.prototype;g.k.Q7=function(z){if(this.T){if(this.T==z)return;yF(this,"Overriding cast session with new session object");vhH(this);this.nH=!1;this.N="unknown";this.T.removeUpdateListener(this.l_);this.T.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Hx)}this.T=z;this.T.addUpdateListener(this.l_);this.T.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Hx);MLH(this,"getMdxSessionStatus")}; g.k.Hy=function(z){this.info("launchWithParams no-op for Cast: "+g.rB(z))}; g.k.stop=function(){this.T?this.T.stop((0,g.p1)(function(){this.PW()},this),(0,g.p1)(function(){this.PW(Error("Failed to stop receiver app."))},this)):this.PW(Error("Stopping cast device without session."))}; g.k.M4=function(){}; g.k.JL=function(){this.info("disposeInternal");vhH(this);this.T&&(this.T.removeUpdateListener(this.l_),this.T.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Hx));this.T=null;wt.prototype.JL.call(this)}; g.k.Xhe=function(z,K){if(!this.CH())if(K)if(K=f$(K),g.$f(K))switch(z=""+K.type,K=K.data||{},this.info("onYoutubeMessage_: "+z+" "+g.rB(K)),z){case "mdxSessionStatus":Kl2(this,K);break;case "loungeToken":pLQ(this,K);break;default:yF(this,"Unknown youtube message: "+z)}else yF(this,"Unable to parse message.");else yF(this,"No data in message.")}; g.k.fn=function(z,K,f,M){g.LJ(this.D);this.D=0;rcf(this.J,this.Y.label,z,this.Y.friendlyName,(0,g.p1)(function(p){p?K(p):M>=0?(yF(this,"Screen "+z+" appears to be offline. "+M+" retries left."),this.D=g.Sg((0,g.p1)(this.fn,this,z,K,f,M-1),300)):f(Error("Unable to fetch screen."))},this),f)}; g.k.oY=function(){return this.T}; g.k.SZ=function(z){this.CH()||z||(yF(this,"Cast session died."),this.PW())};g.h(hB,wt);g.k=hB.prototype;g.k.Q7=function(z){this.T=z;this.T.addUpdateListener(this.Bx)}; g.k.Hy=function(z){this.vx=z;this.Y1()}; g.k.stop=function(){kW4(this);this.T?this.T.stop((0,g.p1)(this.PW,this,null),(0,g.p1)(this.PW,this,"Failed to stop DIAL device.")):this.PW()}; g.k.JL=function(){kW4(this);this.T&&this.T.removeUpdateListener(this.Bx);this.T=null;wt.prototype.JL.call(this)}; g.k.Al=function(z){this.CH()||z||(yF(this,"DIAL session died."),this.C(),this.C=function(){},this.PW())};g.h(Sc,wt);Sc.prototype.stop=function(){this.PW()}; Sc.prototype.Q7=function(){}; Sc.prototype.Hy=function(){g.LJ(this.T);this.T=NaN;var z=bO(this.J.xm(),this.Y.label);z?Da(this,z):this.PW(Error("No such screen"))}; Sc.prototype.JL=function(){g.LJ(this.T);this.T=NaN;wt.prototype.JL.call(this)};g.h(u3,g.Dv);g.k=u3.prototype; g.k.init=function(z,K){chrome.cast.timeout.requestSession=3E4;var f=new chrome.cast.SessionRequest(this.D,[chrome.cast.Capability.AUDIO_OUT]);g.Hg("desktop_enable_cast_connect")&&(f.androidReceiverCompatible=!0);this.N||(f.dialRequest=new chrome.cast.DialRequest("YouTube"));var M=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;z=z||this.W?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var p=(0,g.p1)(this.O6_,this);f=new chrome.cast.ApiConfig(f,(0,g.p1)(this.vt, this),p,M,z);f.customDialLaunchCallback=(0,g.p1)(this.q3x,this);chrome.cast.initialize(f,(0,g.p1)(function(){this.CH()||(chrome.cast.addReceiverActionListener(this.C),lhZ(),this.Y.subscribe("onlineScreenChange",(0,g.p1)(this.S$,this)),this.T=Rqf(this),chrome.cast.setCustomReceivers(this.T,function(){},(0,g.p1)(function(t){this.dI("Failed to set initial custom receivers: "+g.rB(t))},this)),this.publish("yt-remote-cast2-availability-change",EY(this)),K(!0))},this),(0,g.p1)(function(t){this.dI("Failed to initialize API: "+ g.rB(t)); K(!1)},this))}; g.k.r$_=function(z,K){L2("Setting connected screen ID: "+z+" -> "+K);if(this.S){var f=this.S.S;if(!z||f&&f.id!=z)L2("Unsetting old screen status: "+this.S.Y.friendlyName),Pb(this,null)}if(z&&K){if(!this.S){z=bO(this.Y.xm(),z);if(!z){L2("setConnectedScreenStatus: Unknown screen.");return}if(z.idType=="shortLived"){L2("setConnectedScreenStatus: Screen with id type to be short lived.");return}f=hqT(this,z);f||(L2("setConnectedScreenStatus: Connected receiver not custom..."),f=new chrome.cast.Receiver(z.uuid? z.uuid:z.id,z.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM,this.T.push(f),chrome.cast.setCustomReceivers(this.T,function(){},(0,g.p1)(function(M){this.dI("Failed to set initial custom receivers: "+g.rB(M))},this))); L2("setConnectedScreenStatus: new active receiver: "+f.friendlyName);Pb(this,new Sc(this.Y,f),!0)}this.S.M4(K)}else L2("setConnectedScreenStatus: no screen.")}; g.k.Nhq=function(z){this.CH()?this.dI("Setting connection data on disposed cast v2"):this.S?this.S.Hy(z):this.dI("Setting connection data without a session")}; g.k.TM=function(){this.CH()?this.dI("Stopping session on disposed cast v2"):this.S?(this.S.stop(),Pb(this,null)):L2("Stopping non-existing session")}; g.k.requestSession=function(){chrome.cast.requestSession((0,g.p1)(this.vt,this),(0,g.p1)(this.qWV,this))}; g.k.JL=function(){this.Y.unsubscribe("onlineScreenChange",(0,g.p1)(this.S$,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.C);var z=Qsp,K=g.CW("yt.mdx.remote.debug.handlers_");g.R8(K||[],z);g.DO(this.S);g.Dv.prototype.JL.call(this)}; g.k.dI=function(z){$Q("Controller",z)}; g.k.Cj=function(z,K){this.S==z&&(K||Pb(this,null),this.publish("yt-remote-cast2-session-change",K))}; g.k.gbV=function(z,K){if(!this.CH())if(z)switch(z.friendlyName=chrome.cast.unescape(z.friendlyName),L2("onReceiverAction_ "+z.label+" / "+z.friendlyName+"-- "+K),K){case chrome.cast.ReceiverAction.CAST:if(this.S)if(this.S.Y.label!=z.label)L2("onReceiverAction_: Stopping active receiver: "+this.S.Y.friendlyName),this.S.stop();else{L2("onReceiverAction_: Casting to active receiver.");this.S.S&&this.publish("yt-remote-cast2-session-change",this.S.S);break}switch(z.receiverType){case chrome.cast.ReceiverType.CUSTOM:Pb(this, new Sc(this.Y,z));break;case chrome.cast.ReceiverType.DIAL:Pb(this,new hB(this.Y,z,this.J,this.config_));break;case chrome.cast.ReceiverType.CAST:Pb(this,new kQ(this.Y,z,this.config_));break;default:this.dI("Unknown receiver type: "+z.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.S&&this.S.Y.label==z.label?this.S.stop():this.dI("Stopping receiver w/o session: "+z.friendlyName)}else this.dI("onReceiverAction_ called without receiver.")}; g.k.q3x=function(z){if(this.CH())return Promise.reject(Error("disposed"));var K=z.receiver;K.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.dI("Not DIAL receiver: "+K.friendlyName),K.receiverType=chrome.cast.ReceiverType.DIAL);var f=this.S?this.S.Y:null;if(!f||f.label!=K.label)return this.dI("Receiving DIAL launch request for non-clicked DIAL receiver: "+K.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(f&&f.label==K.label&&f.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.S.S)return L2("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.S.S),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.dI('Changing CAST intent from "'+f.receiverType+'" to "dial" for '+K.friendlyName);Pb(this,new hB(this.Y,K,this.J,this.config_))}K=this.S;K.D=z;K.D.appState==chrome.cast.DialAppState.RUNNING?(z=K.D.extraData||{},f=z.screenId||null,a1(K)&&z.loungeToken?z.loungeTokenRefreshIntervalMs?z=wLS(K,{name:K.Y.friendlyName,screenId:z.screenId,loungeToken:z.loungeToken,dialId:K.D.receiver.label, screenIdType:"shortLived"},z.loungeTokenRefreshIntervalMs):(g.fJ(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(z)+".")),z=D11(K,f)):z=D11(K,f)):z=bvQ(K);return z}; g.k.vt=function(z){var K=this;if(!this.CH()&&!this.W){L2("New cast session ID: "+z.sessionId);var f=z.receiver;if(f.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.S)if(f.receiverType==chrome.cast.ReceiverType.CAST)L2("Got resumed cast session before resumed mdx connection."),f.friendlyName=chrome.cast.unescape(f.friendlyName),Pb(this,new kQ(this.Y,f,this.config_),!0);else{this.dI("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var M=this.S.Y,p=bO(this.Y.xm(), M.label);p&&Iq(p,f.label)&&M.receiverType!=chrome.cast.ReceiverType.CAST&&f.receiverType==chrome.cast.ReceiverType.CAST&&(L2("onSessionEstablished_: manual to cast session change "+f.friendlyName),g.DO(this.S),this.S=new kQ(this.Y,f,this.config_),this.S.subscribe("sessionScreen",(0,g.p1)(this.Cj,this,this.S)),this.S.subscribe("sessionFailed",function(){return ap_(K,K.S)}),this.S.Hy(null)); this.S.Q7(z)}}}; g.k.YM=function(){return this.S?this.S.oY():null}; g.k.qWV=function(z){this.CH()||(this.dI("Failed to estabilish a session: "+g.rB(z)),z.code!=chrome.cast.ErrorCode.CANCEL&&Pb(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.k.O6_=function(z){L2("Receiver availability updated: "+z);if(!this.CH()){var K=EY(this);this.G=z==chrome.cast.ReceiverAvailability.AVAILABLE;EY(this)!=K&&this.publish("yt-remote-cast2-availability-change",EY(this))}}; g.k.S$=function(){this.CH()||(this.T=Rqf(this),L2("Updating custom receivers: "+g.rB(this.T)),chrome.cast.setCustomReceivers(this.T,function(){},(0,g.p1)(function(){this.dI("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",EY(this)))}; u3.prototype.setLaunchParams=u3.prototype.Nhq;u3.prototype.setConnectedScreenStatus=u3.prototype.r$_;u3.prototype.stopSession=u3.prototype.TM;u3.prototype.getCastSession=u3.prototype.YM;u3.prototype.requestSession=u3.prototype.requestSession;u3.prototype.init=u3.prototype.init;u3.prototype.dispose=u3.prototype.dispose;var m1S=[];g.k=n2.prototype; g.k.reset=function(z){this.listId="";this.index=-1;this.videoId="";gho(this);this.volume=-1;this.muted=!1;z&&(this.index=z.index,this.listId=z.listId,this.videoId=z.videoId,this.playerState=z.playerState,this.volume=z.volume,this.muted=z.muted,this.audioTrackId=z.audioTrackId,this.trackData=z.trackData,this.S4=z.hasPrevious,this.WC=z.hasNext,this.W=z.playerTime,this.C=z.playerTimeAt,this.Y=z.seekableStart,this.G=z.seekableEnd,this.T=z.duration,this.D=z.loadedTime,this.S=z.liveIngestionTime,this.J= !isNaN(this.S))}; g.k.isPlaying=function(){return this.playerState==1}; g.k.isBuffering=function(){return this.playerState==3}; g.k.yT=function(){return this.playerState==1081}; g.k.uy=function(z){this.T=isNaN(z)?0:z}; g.k.getDuration=function(){return this.J?this.T+Wb(this):this.T}; g.k.clone=function(){return new n2(d1f(this))};g.h(cb,g.Dv);g.k=cb.prototype;g.k.getState=function(){return this.T}; g.k.Uc=function(){return this.J.getReconnectTimeout()}; g.k.uo=function(){this.J.reconnect()}; g.k.play=function(){AB(this)?(this.S?this.S.play(null,g.DZ,xQ(this,"play")):XE(this,"play"),AY_(this,1,gt(sY(this))),this.publish("remotePlayerChange")):jc(this,this.play)}; g.k.pause=function(){AB(this)?(this.S?this.S.pause(null,g.DZ,xQ(this,"pause")):XE(this,"pause"),AY_(this,2,gt(sY(this))),this.publish("remotePlayerChange")):jc(this,this.pause)}; g.k.seekTo=function(z){if(AB(this)){if(this.S){var K=sY(this),f=new chrome.cast.media.SeekRequest;f.currentTime=z;K.isPlaying()||K.isBuffering()?f.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:f.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.S.seek(f,g.DZ,xQ(this,"seekTo",{newTime:z}))}else XE(this,"seekTo",{newTime:z});AY_(this,3,z);this.publish("remotePlayerChange")}else jc(this,g.Bo(this.seekTo,z))}; g.k.stop=function(){if(AB(this)){this.S?this.S.stop(null,g.DZ,xQ(this,"stopVideo")):XE(this,"stopVideo");var z=sY(this);z.index=-1;z.videoId="";gho(z);YQ(this,z);this.publish("remotePlayerChange")}else jc(this,this.stop)}; g.k.setVolume=function(z,K){if(AB(this)){var f=sY(this);if(this.Y){if(f.volume!=z){var M=Math.round(z)/100;this.Y.setReceiverVolumeLevel(M,(0,g.p1)(function(){f2("set receiver volume: "+M)},this),(0,g.p1)(function(){this.dI("failed to set receiver volume.")},this))}f.muted!=K&&this.Y.setReceiverMuted(K,(0,g.p1)(function(){f2("set receiver muted: "+K)},this),(0,g.p1)(function(){this.dI("failed to set receiver muted.")},this))}else{var p={volume:z, muted:K};f.volume!=-1&&(p.delta=z-f.volume);XE(this,"setVolume",p)}f.muted=K;f.volume=z;YQ(this,f)}else jc(this,g.Bo(this.setVolume,z,K))}; g.k.Ay=function(z,K){if(AB(this)){var f=sY(this);z={videoId:z};K&&(f.trackData={trackName:K.name,languageCode:K.languageCode,sourceLanguageCode:K.translationLanguage?K.translationLanguage.languageCode:"",languageName:K.languageName,kind:K.kind},z.style=g.rB(K.style),g.Mn(z,f.trackData));XE(this,"setSubtitlesTrack",z);YQ(this,f)}else jc(this,g.Bo(this.Ay,z,K))}; g.k.setAudioTrack=function(z,K){AB(this)?(K=K.getLanguageInfo().getId(),XE(this,"setAudioTrack",{videoId:z,audioTrackId:K}),z=sY(this),z.audioTrackId=K,YQ(this,z)):jc(this,g.Bo(this.setAudioTrack,z,K))}; g.k.playVideo=function(z,K,f,M,p,t,B){M=M===void 0?null:M;p=p===void 0?null:p;t=t===void 0?null:t;B=B===void 0?null:B;var v=sY(this),I={videoId:z};f!==void 0&&(I.currentIndex=f);i3(v,z,f||0);K!==void 0&&(JB(v,K),I.currentTime=K);M&&(I.listId=M);p&&(I.playerParams=p);t&&(I.clickTrackingParams=t);B&&(I.locationInfo=g.rB(B));XE(this,"setPlaylist",I);M||YQ(this,v)}; g.k.Pu=function(z,K){if(AB(this)){if(z&&K){var f=sY(this);i3(f,z,K);YQ(this,f)}XE(this,"previous")}else jc(this,g.Bo(this.Pu,z,K))}; g.k.nextVideo=function(z,K){if(AB(this)){if(z&&K){var f=sY(this);i3(f,z,K);YQ(this,f)}XE(this,"next")}else jc(this,g.Bo(this.nextVideo,z,K))}; g.k.gT=function(){if(AB(this)){XE(this,"clearPlaylist");var z=sY(this);z.reset();YQ(this,z);this.publish("remotePlayerChange")}else jc(this,this.gT)}; g.k.ZV=function(){AB(this)?XE(this,"dismissAutoplay"):jc(this,this.ZV)}; g.k.dispose=function(){if(this.T!=3){var z=this.T;this.T=3;this.publish("proxyStateChange",z,this.T)}g.Dv.prototype.dispose.call(this)}; g.k.JL=function(){sPf(this);this.J=null;this.C.clear();dt(this,null);g.Dv.prototype.JL.call(this)}; g.k.rH=function(z){if((z!=this.T||z==2)&&this.T!=3&&z!=0){var K=this.T;this.T=z;this.publish("proxyStateChange",K,z);if(z==1)for(;!this.C.isEmpty();)K=z=this.C,K.S.length===0&&(K.S=K.Y,K.S.reverse(),K.Y=[]),z.S.pop().apply(this);else z==3&&this.dispose()}}; g.k.X81=function(z,K){this.publish(z,K)}; g.k.Rdh=function(z){if(!z)this.w4(null),dt(this,null);else if(this.Y.receiver.volume){z=this.Y.receiver.volume;var K=sY(this),f=Math.round(100*z.level||0);if(K.volume!=f||K.muted!=z.muted)f2("Cast volume update: "+z.level+(z.muted?" muted":"")),K.volume=f,K.muted=!!z.muted,YQ(this,K)}}; g.k.w4=function(z){f2("Cast media: "+!!z);this.S&&this.S.removeUpdateListener(this.D);if(this.S=z)this.S.addUpdateListener(this.D),jP8(this),this.publish("remotePlayerChange")}; g.k.wxx=function(z){z?(jP8(this),this.publish("remotePlayerChange")):this.w4(null)}; g.k.Io=function(){XE(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.k.yLq=function(){var z=nhS();z&&dt(this,z)}; g.k.dI=function(z){$Q("CP",z)};g.h(rt,g.Dv);g.k=rt.prototype; g.k.connect=function(z,K){if(K){var f=K.listId,M=K.videoId,p=K.videoIds,t=K.playerParams,B=K.clickTrackingParams,v=K.index,I={videoId:M},G=K.currentTime,b=K.locationInfo;K=K.loopMode;G!==void 0&&(I.currentTime=G<=5?0:G);t&&(I.playerParams=t);b&&(I.locationInfo=b);B&&(I.clickTrackingParams=B);f&&(I.listId=f);p&&p.length>0&&(I.videoIds=p.join(","));v!==void 0&&(I.currentIndex=v);this.Bx&&(I.loopMode=K||"LOOP_MODE_OFF");f&&(this.S.listId=f);this.S.videoId=M;this.S.index=v||0;this.S.state=3;JB(this.S, G);this.C="UNSUPPORTED";f=this.Bx?"setInitialState":"setPlaylist";FE("Connecting with "+f+" and params: "+g.rB(I));this.Y.connect({method:f,params:g.rB(I)},z,Mp8())}else FE("Connecting without params"),this.Y.connect({},z,Mp8());Fl_(this)}; g.k.UU=function(z){this.Y.UU(z)}; g.k.dispose=function(){this.CH()||(g.ov("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),OY(this,3));g.Dv.prototype.dispose.call(this)}; g.k.JL=function(){OvQ(this);ZvT(this);rYZ(this);g.LJ(this.D);this.D=NaN;g.LJ(this.N);this.N=NaN;this.J=null;g.m6(this.Y1);this.Y1.length=0;this.Y.dispose();g.Dv.prototype.JL.call(this);this.C=this.G=this.T=this.S=this.Y=null}; g.k.gt=function(z){if(!this.T||this.T.length===0)return!1;for(var K=g.a(this.T),f=K.next();!f.done;f=K.next())if(!f.value.capabilities.has(z))return!1;return!0}; g.k.xG=function(){var z=3;this.CH()||(z=0,isNaN(this.Qg())?this.Y.Is()&&isNaN(this.W)&&(z=1):z=2);return z}; g.k.zA=function(z){FE("Disconnecting with "+z);g.ov("yt.mdx.remote.remoteClient_",null);OvQ(this);this.publish("beforeDisconnect",z);z==1&&Du();this.Y.disconnect(z);this.dispose()}; g.k.nQ=function(){var z=this.S;this.J&&(z=this.S.clone(),i3(z,this.J,z.index));return d1f(z)}; g.k.odx=function(z){var K=this,f=new n2(z);f.videoId&&f.videoId!=this.S.videoId&&(this.J=f.videoId,g.LJ(this.D),this.D=g.Sg(function(){if(K.J){var p=K.J;K.J=null;K.S.videoId!=p&&Za(K,"getNowPlaying")}},5E3)); var M=[];this.S.listId==f.listId&&this.S.videoId==f.videoId&&this.S.index==f.index||M.push("remoteQueueChange");this.S.playerState==f.playerState&&this.S.volume==f.volume&&this.S.muted==f.muted&>(this.S)==gt(f)&&g.rB(this.S.trackData)==g.rB(f.trackData)||M.push("remotePlayerChange");this.S.reset(z);g.co(M,function(p){this.publish(p)},this)}; g.k.P4=function(){var z=this.Y.getDeviceId(),K=g.yQ(this.T,function(f){return f.type=="REMOTE_CONTROL"&&f.id!=z}); return K?K.id:""}; g.k.Qg=function(){return this.Y.Uc()}; g.k.rR=function(){return this.C||"UNSUPPORTED"}; g.k.tv=function(){return this.G||""}; g.k.qF=function(){!isNaN(this.Qg())&&this.Y.uo()}; g.k.b3d=function(z,K){Za(this,z,K);CiH(this)}; g.k.Y5=function(){var z=g.YB("SAPISID","")||g.YB("__Secure-1PAPISID")||"",K=g.YB("__Secure-3PAPISID","")||"";if(!z&&!K)return"";z=g.NW(g.Bi(z),2);K=g.NW(g.Bi(K),2);return g.NW(g.Bi(","+z+","+K),2)}; rt.prototype.subscribe=rt.prototype.subscribe;rt.prototype.unsubscribeByKey=rt.prototype.Or;rt.prototype.getProxyState=rt.prototype.xG;rt.prototype.disconnect=rt.prototype.zA;rt.prototype.getPlayerContextData=rt.prototype.nQ;rt.prototype.setPlayerContextData=rt.prototype.odx;rt.prototype.getOtherConnectedRemoteId=rt.prototype.P4;rt.prototype.getReconnectTimeout=rt.prototype.Qg;rt.prototype.getAutoplayMode=rt.prototype.rR;rt.prototype.getAutoplayVideoId=rt.prototype.tv;rt.prototype.reconnect=rt.prototype.qF; rt.prototype.sendMessage=rt.prototype.b3d;rt.prototype.getXsrfToken=rt.prototype.Y5;rt.prototype.isCapabilitySupportedOnConnectedDevices=rt.prototype.gt;g.h(vTo,Bb);g.k=vTo.prototype;g.k.xm=function(z){return this.z8.$_gs(z)}; g.k.contains=function(z){return!!this.z8.$_c(z)}; g.k.get=function(z){return this.z8.$_g(z)}; g.k.start=function(){this.z8.$_st()}; g.k.add=function(z,K,f){this.z8.$_a(z,K,f)}; g.k.remove=function(z,K,f){this.z8.$_r(z,K,f)}; g.k.Rr=function(z,K,f,M){this.z8.$_un(z,K,f,M)}; g.k.JL=function(){for(var z=this.S.length,K=0;K1&&!this.U.getOption("remote","quickCast")?(this.hF=g.s9(z,this.S,this),this.Ym(g.UZ(z,this.S)),z=this.U.getOption("remote","currentReceiver"),z=this.S(z),this.options[z]&&this.bI(z),this.enable(!0)):this.enable(!1)}; wO.prototype.S=function(z){return z.key}; wO.prototype.AD=function(z){return z==="cast-selector-receiver"?"Truy\u1ec1n...":this.hF[z].name}; wO.prototype.Y3=function(z){g.iP.prototype.Y3.call(this,z);this.U.setOption("remote","currentReceiver",this.hF[z]);this.zP.Ip()};g.h(l68,g.R5);g.k=l68.prototype; g.k.create=function(){var z=this.player.Z(),K=g.Aw(z);z={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:z.B("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:z.B("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:z.B("enable_cast_short_lived_lounge_token")};wMp(K,z);this.subscriptions.push(g.IP("yt-remote-before-disconnect",this.saL,this));this.subscriptions.push(g.IP("yt-remote-connection-change",this.QFf,this));this.subscriptions.push(g.IP("yt-remote-receiver-availability-change",this.Uq, this));this.subscriptions.push(g.IP("yt-remote-auto-connect",this.Z6E,this));this.subscriptions.push(g.IP("yt-remote-receiver-resumed",this.f3f,this));this.subscriptions.push(g.IP("mdx-privacy-popup-confirm",this.ThL,this));this.subscriptions.push(g.IP("mdx-privacy-popup-cancel",this.lf1,this));this.Uq()}; g.k.load=function(){this.player.cancelPlayback();g.R5.prototype.load.call(this);this.qM=new meS(this.player.Z(),this);this.player.Aq(this.qM);this.ly=new PcZ(this,this.player,this.AB);var z=(z=uXH())?z.currentTime:0;var K=a69()?new cb(pB(),void 0):null;z==0&&K&&(z=gt(sY(K)));z!==0&&this.C6(z);V3Q(this,this.Dv,this.Dv);this.player.D7(6)}; g.k.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.gN();this.Ya=this.j4;g.yj(this.ly,this.AB);this.AB=this.qM=this.ly=null;g.R5.prototype.unload.call(this);this.player.D7(5);Dm(this)}; g.k.JL=function(){g.GW(this.subscriptions);g.R5.prototype.JL.call(this)}; g.k.Q6=function(z){var K=g.i8.apply(1,arguments);this.loaded&&this.ly.hU.apply(this.ly,[z].concat(g.P(K)))}; g.k.getAdState=function(){return this.lj}; g.k.S4=function(){return this.AB?sY(this.AB).S4:!1}; g.k.WC=function(){return this.AB?sY(this.AB).WC:!1}; g.k.C6=function(z,K){this.sb=z||0;this.player.publish("progresssync",z,K);this.player.rO("onVideoProgress",z||0)}; g.k.getCurrentTime=function(){return this.sb}; g.k.getDuration=function(){return sY(this.AB).getDuration()||0}; g.k.ll=function(){var z=sY(this.AB);return z.J?z.S+Wb(z):z.S}; g.k.jo=function(){return sY(this.AB).D}; g.k.HW=function(){return iv4(sY(this.AB))}; g.k.BX=function(){var z=sY(this.AB);return z.Y>0?z.Y+Wb(z):z.Y}; g.k.getProgressState=function(){var z=sY(this.AB),K=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!z.yT()&&this.player.t_(),clipEnd:K.clipEnd,clipStart:K.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.ll(),isAtLiveHead:this.isAtLiveHead(),loaded:this.jo(),seekableEnd:this.HW(),seekableStart:this.BX(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.k.isAtLiveHead=function(){return iv4(sY(this.AB))-this.getCurrentTime()<=1}; g.k.nextVideo=function(){this.AB&&this.AB.nextVideo()}; g.k.Pu=function(){this.AB&&this.AB.Pu()}; g.k.saL=function(z){z===1&&(this.rg=this.AB?sY(this.AB):null)}; g.k.QFf=function(){var z=a69()?new cb(pB(),void 0):null;if(z){var K=this.Ya;this.loaded&&this.unload();this.AB=z;this.rg=null;K.key!==this.j4.key&&(this.Ya=K,this.load())}else g.DO(this.AB),this.AB=null,this.loaded&&(this.unload(),(z=this.rg)&&z.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(z.videoId,gt(z)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.k.Uq=function(){var z=[this.j4],K=z.concat,f=DeH();m_()&&g.AV("yt-remote-cast-available")&&f.push({key:"cast-selector-receiver",name:"Cast..."});this.hF=K.call(z,f);z=ku_()||this.j4;yK(this,z);this.player.rO("onMdxReceiversChange")}; g.k.Z6E=function(){var z=ku_();yK(this,z)}; g.k.f3f=function(){this.Ya=ku_()}; g.k.ThL=function(){this.cR=!0;Dm(this);vy=!1;t7&&NF(t7,1);t7=null}; g.k.lf1=function(){this.cR=!1;Dm(this);yK(this,this.j4);this.Ya=this.j4;vy=!1;t7=null;this.player.playVideo()}; g.k.Lo=function(z,K){switch(z){case "casting":return this.loaded;case "receivers":return this.hF;case "currentReceiver":return K&&(K.key==="cast-selector-receiver"?Wl1():yK(this,K)),this.loaded?this.Ya:this.j4;case "quickCast":return this.hF.length===2&&this.hF[1].key==="cast-selector-receiver"?(K&&Wl1(),!0):!1}}; g.k.Io=function(){this.AB.Io()}; g.k.g_=function(){return!1}; g.k.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.k.isLoggedIn=function(){var z,K;return((z=g.zM("PLAYER_CONFIG"))==null?void 0:(K=z.args)==null?void 0:K.authuser)!==void 0?!0:!(!g.zM("SESSION_INDEX")&&!g.zM("LOGGED_IN"))};g.a5("remote",l68);})(_yt_player);